Freigeben über


BDD 2007 - How to create a Custom task sequence with reboots

I am often asked how to setup a custom task sequence that will continue after a reboot.

If you have created a custom task sequence to install a number of applications that includes a reboot then you will know the problem I am taking about. When you do this you will find that the computer will reboot and then return to the logon prompt. The computer does not automatically logon :(. So you logon manually and BDD does not continue, so you have to manually launch the litetouch.wsf script :(. Then FINALLY the script will continue happily, until next next reboot at least.

Well I don't find this very convenient and I bet you don't either. So I have created a script that will setup required components to allow the BDD processes to continue as they would in a normal BDD deployment process.

The script configures three main components:

  1. Populates the required auto logon keys in the registry
  2. Populates the MININT folder with the scripts required to launch the script at when the client reboots
  3. Configures the BDD script to launch at reboot by creating a shortcut to the litetouch.wsf script in the "all users" startup folder
  4. Configures the correct phase information so that BDD knows what phase it should process

I find this script very useful, hopefully you find this script as useful as I do.

To implement the script follow the steps detailed below:

Update the deployment point rules

The script uses the ADMINPASSWORD property specified using BDD rules to determine the password that should be used for the local administrator account. If this is not correct then you can change the following line from the script to correctly reflect the value you want to use:

 oShell.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword", oEnvironment.item("AdminPassword"), "REG_SZ"

Update the scripts folder

Next you must add the script to the .\distribution\scripts folder. You will notice that the script names have the prefix "Z-" this is because BDD automatically copies all scripts that start with "Z" from the distribution share to other deployment points when they are updated.

Update the build task sequence

The next thing you do is add the scripts to the build task sequence. I would recommend creating an application for each script that executes a script and then add it to the task sequence as shown below. It is important to note that the "CUSTOM TS - Setup for reboot " task is run before the first reboot is performed.

image

Update your deployment points

Finally you should update your deployment points to so that these changes are propagated to the correct places.

For more information about custom task sequences then please refer to the following links:

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .

Z-SetupForAutologon.zip

Comments

  • Anonymous
    January 01, 2003
    Hi Scott, These settings have not changed between BDD and MDT. Did you check the entries in the unattend.xml in the from windowspantherunattendgc folder? Thanks, Ben

  • Anonymous
    January 01, 2003
    Unfortunately I can not think of any other reason why this  might not work if it worked with BDD 2007. I would suggest that you try posting the question at the following location, the broader audience may help. http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.deployment.desktop Thanks, Ben

  • Anonymous
    January 01, 2003
    Hi Brad, This is not required for ConfigMgr but it is required for MDT. Thanks, Ben

  • Anonymous
    January 01, 2003
    Ben,     Thanks for the response.  I have checked the windowspantherunattend.xml file and the settings are correct in there.  There is no unattend file in windowspantherunattendgc.  In the unattendgc folder there is only 4 files.  Diagerr, diagwrn, setupact and setuperr.  The unattend has this for autologon <AutoLogon>     <Enabled>true</Enabled>     <Username>Administrator</Username>     <Domain></Domain>  <Password>SENSITIVEDATADELETED</Password>     <LogonCount>999</LogonCount> </AutoLogon> Is there any reason autologon would work even with the above settings?  Is there any location where this event is logged.  I checked the event viewer and there are no entries for the login attempt. Any help is appreciated.

  • Anonymous
    January 01, 2003
    Hi Andy, You are correct. My script assumes that you have rights to the distribution$ share. If you do not have rights then you will need to pre populate the C:minintscripts folder and then point the shortcut to there. I will have a look at this over the next few days and get back too you. Thanks, Ben

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    Hi Andy, I have updated the script with the changes you suggested. Give it a go and see what you think. Thanks, Ben

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    October 21, 2007
    Hi, The script doesn't seem to find the correct Admin password for Windows XP Lite Touch installations.  Is the best alternative to hard code the password in the script? Why do you recommend creating an application for each script? Also, any chance that you could please share the CONFIG-... scripts shown in the screen shot? Thanks for a great blog.

  • Anonymous
    October 31, 2007
    Ben, Your script creates a shortcut in startup folder to Litetouch.wsf located in %deployroot%Scripts, but OS don't have credentials to connect to %deployroot% after restart and autologon :( The shortcut created by the script should point to c:minintscriptsLitetouch.wsf, am i right? Thanks in advance, Andy

  • Anonymous
    November 08, 2007
    Ben, Your script is working great. Thanks Andy

  • Anonymous
    February 08, 2008
    Hi Ben, I've been struggling with getting my autologon to work in MDT for the last few days.  FINALLY, I came across this article.  I would like to clarify a few things. 1)Update cs.ini: AdminPassword=Password, update Deployment Point. 2)Create a Z-SetupForAutoLogon.wsf and put the following information into the script: oShell.RegWrite "HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionWinlogonDefaultPassword", oEnvironment.item("AdminPassword"), "REG_SZ" Save to /Distribution/Scripts directory. 3)Update the TS before the first reboot. "I would recommend creating an application for each script that executes a script and then add it to the task sequence as shown below. It is important to note that the "CUSTOM TS - Setup for reboot " task is run before the first reboot is performed." I'm not following you on this note.  Create an application for each script that executs a script and add it to TS....?

  • Anonymous
    February 12, 2008
    Ben, This helped out tremendously.  I cannot thank you enough.  Your blog has been one of the best resources for MDT topics.  I appreciate your willingness to share this information.   Best regards, Rich

  • Anonymous
    March 13, 2008
    I've upgraded to MDT recently and since have had an issues with litetouch deployments and autoadminlogon.  I deploy my custom wim with no issues.  The standard Vista setup goes through fine but when the system reboots it the autoadminlogon does work.  It says incorrect username or password.  If I enter the credentials manually it logs in and litetouch starts it's thing and the build finishes.  I've confirmed the autologon entries are in the unattend.xml file correctly and verified them several times.  This was not an issue when using BDD2007.  Any thoughts?  Do I need to use the script solution you provide here.  I'm not using a custom task sequence.

  • Anonymous
    April 08, 2008
    is this required if you have configmgr and mdt?