Neil Peterson at myITforum.com

Systems Management Adventure Seeker..

Custom OSD Scripts - Troubleshooting
Due to the Task Sequence dependencies troubleshooting custom OSD scripts can be somewhat of a pain. Here are a few basic tips that may not be so obvious when beginning this process. 

 

1.       Remove all Task Sequence dependencies and interactions.  Basically write up a script that will perform what you want it to perform (set AD computer Description for example). Get this working and then add in the Task Sequence interaction.

2.       On you boot image make sure you “Enable Command support”. This is done on the Windows PE tab of the boot images properties.

3.       I often elected to leave my custom scripts off of the task sequence rather running them manually until they were in working order. Do so by pressing F8 to open up a command prompt. Connect to a network share on which the scripts are stored, this can be done with the following “net use j: \\server\share”. Depending on security you may have to add some credentials. Once complete simply run your scripts, or copy them local and run if needed. Considering they are being executed inside of the Task Sequence environment all TS variables should be valid. If you run into an error, make changes on the script and run it again. Once you have opened up a command prompt, the TS will not reboot the machine until the command prompt is closed. This allows for ample time to hack through the scripts. One thing to note, I found doing this before the Post Install reboot to be the most helpful place. Even though the machine will not re-boot with the command prompt open, during the State Restore group the TS environment seams to close and your variables will no longer be valid.

4.       Here is a script that will echo back all TS variables. I use this quite often when needing a solid validation on these values. I run it just as I do the scripts in the above step.

Dim oVar, oTSEnv

Set oTSEnv = CreateObject("Microsoft.SMS.TSEnvironment")

For Each oVar In oTSEnv.GetVariables

WScript.Echo " "& oVar & "=" & oTSEnv(oVar)

Next

5.       Finally – when making changes to your TS scripts remember to update your DP’s.

This is all really just basic stuff but I thought I would wrap up these blogs with my trouble shooting experiences.

 

Published Thursday, November 20, 2008 10:40 AM by xneilpetersonx

Comments

No Comments