myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


ConfigMgr HTA

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> ConfigMgr HTA Page: [1]
Login
Message << Older Topic   Newer Topic >>
ConfigMgr HTA - 7/7/2008 2:56:16 PM   
egiroux

 

Posts: 169
Score: 4
Joined: 4/4/2006
From: Portland, Maine
Status: offline
I'm trying to get my custom HTA to run as part of my ConfigMgr task sequence.  I've got my User Exit script executing from my MDT integrated task sequence in ConfigMgr.  In my SMS 2003 User Exit I was able to run something like this to get my HTA to launch:

If Len(oEnvironment.Item("OSDINSTALLPROGRAM")) = 0 Then
             iRetVal = wshShell.Run("setName.hta", 1, true)
Do Until oEnvironment.Item("MYNEWOSDPROGRAM") <> ""
             Wscript.Sleep 3000
Loop
End If

With ConfigMgr the hta never runs.  My TS gets hung trying to do so.  I've made sure to add HTA support to my WinPE 2.1 boot images.  Is there some new trick or new syntax to get this to work with ConfigMgr?
Post #: 1
RE: ConfigMgr HTA - 7/8/2008 5:25:44 PM   
dhicks

 

Posts: 10
Score: 0
Joined: 2/6/2007
Status: offline
This may not be the answer but I particiapated in a project where the task sequence launched a pre-validation script that displayed an HTA. The trick as I recall was simply to make sure the HTA and the supporting scripts get copied to the local system root (System being built) I will confirm with the guy who did it and get back to you. But I am pretty sure this was the trick as it were.

(in reply to egiroux)
Post #: 2
RE: ConfigMgr HTA - 8/13/2008 11:41:32 AM   
egiroux

 

Posts: 169
Score: 4
Joined: 4/4/2006
From: Portland, Maine
Status: offline
Anyone been able to get this working?  Piece by piece I'm transferring my SMS 2003 OSD customizations to ConfigMgr.  I still can't get hta's to work however.  I've read about the UnknownComputer hta and the pre-execution hook.  The problem is that I need to be able to run an hta not at the beginning of the process before the TS starts, but during the first Gather action.  I've got everything setup great with my CustomSettings.ini and UserExit.vbs so that during the rules processing of CS.ini I'm querying a SQL database for a machine record for the system being built.  One of the data fields returned from SQL matches a Task Sequence variable that dictates which of my 3 images to load during the task sequence.  I need to be able to run an hta, or provide some other method for user input, in the case where there is not a matching record in the SQL database.  Might have to start looking at alternatives other than hta, but I suspect the task sequence is going to hide anything I try to launch to gather user input.  Help!

(in reply to dhicks)
Post #: 3
RE: ConfigMgr HTA - 8/14/2008 11:44:32 AM   
jquirk822


Posts: 189
Score: 12
Joined: 2/20/2003
Status: offline
Hi Egrioux,
We use an HTA to populate quite a few variables in the New Computer scenario (they're all migrated for a refresh). We no longer use userexit scripts though, we just copy the HTA into the MDTookit Scripts source folder, update the DPs and add an entry to the TS to call "%SCRIPTROOT%\ComputerConfig.hta"


No good?

You could set a condition on the task sequence entry to only call this step if Variable OSDINSTALLPROGRAM=0

JQ

< Message edited by jquirk822 -- 8/14/2008 11:46:50 AM >

(in reply to egiroux)
Post #: 4
RE: ConfigMgr HTA - 8/18/2008 9:50:41 AM   
jquirk822


Posts: 189
Score: 12
Joined: 2/20/2003
Status: offline
callen416 asked for the code around moving the task sequence window. This isn't quite as straightforward as you might like. With a couple of minor modifications we used the AutoIt approach detailed in the excellent Deployment Guys blog posting here.

Hope that helps.

John

(in reply to jquirk822)
Post #: 5
RE: ConfigMgr HTA - 8/18/2008 2:06:12 PM   
egiroux

 

Posts: 169
Score: 4
Joined: 4/4/2006
From: Portland, Maine
Status: offline
that's interesting.  I will give it a shot.  I'm also going to read up on the moving the TS window entry you have.  Currently in my HTA I have the following lines to move the HTA to the top left:

window.moveTo 0,0
window.focus

(in reply to jquirk822)
Post #: 6
RE: ConfigMgr HTA - 8/20/2008 11:47:38 AM   
callen416

 

Posts: 40
Score: 0
Joined: 9/21/2005
Status: offline
Ill try that. Thanks

(in reply to egiroux)
Post #: 7
RE: ConfigMgr HTA - 8/20/2008 11:55:33 AM   
rbennett806


Posts: 825
Score: 13
Joined: 6/14/2006
Status: offline
Just tossing in my two cents... We run an HTA at the beginning of the OSD deployment process to our bare metal systems that allow our techs to select the desired image to be deployed to the machine. It then creates a resource object for the machine if one doesn't exist and places it in the collection that has the desired image advertised to it. So you could probably use a standard HTA at the beginning and not have to worry about it kicking off partway through the process. Instead of having it query the tech, yours would simply connect to your SQL database and pull the needed information...

And I use a heavily customized version of the "UnknownSystem.hta" file (http://www.myitforum.com/articles/11/view.asp?id=11652)

(in reply to callen416)
Post #: 8
RE: ConfigMgr HTA - 8/20/2008 12:11:51 PM   
hcortez463


Posts: 780
Score: 62
Joined: 4/8/2005
Status: offline
u mind sharing your hta :)

_____________________________

If it Helps, Please rate....

(in reply to rbennett806)
Post #: 9
RE: ConfigMgr HTA - 8/21/2008 9:25:26 PM   
hcortez463


Posts: 780
Score: 62
Joined: 4/8/2005
Status: offline
sure would like to see that hta of yorus.. lOL

_____________________________

If it Helps, Please rate....

(in reply to hcortez463)
Post #: 10
RE: ConfigMgr HTA - 8/22/2008 6:11:18 PM   
rbennett806


Posts: 825
Score: 13
Joined: 6/14/2006
Status: offline
I've posted my customized HTA frontend here: http://www.myitforum.com/articles/11/view.asp?id=11652. If you have any questions on it, you'll probably need to start a new post somewhere in the forums. Good luck!

(in reply to hcortez463)
Post #: 11
RE: ConfigMgr HTA - 8/26/2008 8:35:36 AM   
egiroux

 

Posts: 169
Score: 4
Joined: 4/4/2006
From: Portland, Maine
Status: offline
I've finally got things working the way I want.  Here's how it's going:

At the end of my Initialization phase I have a Gather action that processes rules in CustomSettings.ini.  One of the steps in the INI queries a SQL database with the Serial# of the target computer.  If not match is found (a match would pull a value for the OSDINSTALLPROGRAM variable) then my HTA front-end is displayed.  The state of the OSDINSTALLPROGRAM variable gets checked from and the HTA gets called from a UserExit script. Here's the line of code from my UserExit that was giving me problems with having the HTA launch properly at first:

iRetVal = wshShell.Run("cmd.exe /c start ""MYHTA1"" ""%DEPLOYROOT%\Scripts\Frontend.hta""", 1, true)

Once I got the HTA to actually launch it took a little effort to get all the functionality that previously worked with SMS 2003 OSD to work with ConfigMgr.  The biggest thing was changing everything from using the OSD Environment object to the Microsoft.SMS.TSEnvironment object.  Aside from that I had a couple snags with some external calls the hta makes to a separate script.  This just had to do with working directories.  I have my hta in the Scripts folder of my MDT Toolkit package.  My UserExit is in my MDT Settings package so I had trouble just referencing the script names.  I had to use the full path to %DeployRoot%\Scripts\...... to get all the calls to work.

With that working I started playing around with the AutoIT script to move the TS window.  This was pretty easy to make work.  I downloaded AutoIt and after a couple tests I got my HTA to execute the AutoIT script to move the TS window.  My HTA is at the top left and it moves the TS window down and over to the right so the HTA is fully visible.  Pretty handy.

I also have a 2nd HTA that launches in the Preinstall phase and the StateRestore phase.  This one is informational for the tech and just displays a few of the key deployment variables providing notification of which type of build is coming down, log share, target user, new computer name, etc.

Today's task is to figure out a quick and easy way to re-imge machines once they're in the SMS database.  Anyone got a script that will move a particular resource to the collection where my task sequence is advertised?

(in reply to rbennett806)
Post #: 12
RE: ConfigMgr HTA - 8/26/2008 11:25:11 AM   
rbennett806


Posts: 825
Score: 13
Joined: 6/14/2006
Status: offline
Look at the "AddMachineToCollection" function within the "UnknownSystem.HTA". You can grab a copy here: http://www.myitforum.com/articles/11/view.asp?id=11652

(in reply to egiroux)
Post #: 13
RE: ConfigMgr HTA - 8/26/2008 1:28:13 PM   
egiroux

 

Posts: 169
Score: 4
Joined: 4/4/2006
From: Portland, Maine
Status: offline
I ripped some of the code from PXEFilter.vbs and it seems to do the trick. 

Checks to see if the computer is in the ConfigMgr DB
If it's not, it adds it
Checks if the computer is in the collection the TS is advertised to
If it's not, it adds it

(in reply to rbennett806)
Post #: 14
Page:   [1]
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> ConfigMgr HTA Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.281