Everyone knows that the Deployment Server can automatically install Windows on a machine
via a job deployment, but that job usually takes quite a bit of time and a few reboots
There is a faster way. With the Scripted OS install that is built into the Deployment
Server, it first deploys a Fat32 DOS image, followed by running a script to copy over
files from the DS for configuration, and then runs the install by calling the WINNT.EXE
from the deployment server. This is fine if you have the time to sit and wait for the
install to copy over the needed install files, and then start the setup. In-between the
copying of files (which takes a long time), the drive is converted from Fat32 to NTFS, again
taking more time. In our environment, we do not always have the luxury of time. In this
article, I will show you how to streamline the install process.
Okay, let us look at some of the things we will need before we begin:
- A blank hard drive
- A Windows XP CD(preferably not an OEM disk as these may or may not come with files for a specific computer manufacturer)
- Unattend.txt and aclient.inp files. You can obtain the unattend.txt file by creating a standard Scripted OS Install job, or you can choose to make this yourself with Microsoft's Setup Manager found within the Support Tools on a Windows XP CD. For more info on this, visit http://unattended.msfn.org/unattended.xp. The Aclient.inp can be created with the Deployment Server Console.
Step 1: Create your unattend.txt and aclient.inp
Step 2: Copy these files to a location on your DS, making sure to note the location as it will be used later.
Step 3: Format your blank hard drive to NTFS.
Step 4: Copy the i386 folder from your Windows XP disk to your freshly formatted hard drive.
Step 5: Upload an image of your drive with the i386 folder to your deployment server (you may want to name this something easy to remember, like i386NTFS.img)
Now that we have an image, we can start building the actual job for scripting the OS install. Create a new job and add in an image deployment task. You will want to use Rdeployt for the imaging software and WinPE 32bit for the Preboot environment so there are fewer reboots. The image to be deployed is the one you captured earlier. For the advanced options, we have ours set to Leave the Automation Partition, but delete the OEM Partition. This really depends on your particular environment and what you want to set it to.
Optional Step 1: If you want to create this as a hardware independent install, there are many ways to complete this. In our environment, we use a hand created script to copy down the drivers based on the product name. I have attached a copy of this script below, but I am not going to go into detail as to how it was created or what properties need to be changed for your environment. You may PM me if you would like to know the mechanics behind creating something like this. It takes a little trial and error to tailor this to different environments. You will also need to make sure your unattend.txt file has a line called OemPnPDriversPath that outlines the locations on your hard drive that you copy the drivers to so that the install knows where to grab them from.
REM Copy Driver files to the production partition before the REM operating system starts. REM This section is used to locate and use specific drivers based on the model of REM computer running the job. C: md Drivers F: if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="Latitude_D600" goto D600 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="latitude_d600" goto D600 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="Latitude_D610" goto D610 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="latitude_d610" goto D610 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="Latitude_D620" goto D620 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="latitude_d620" goto D620 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="Latitude_D630" goto D630 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="latitude_d630" goto D630 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="Latitude_X300" goto X300 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="latitude_x300" goto X300 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="latitude_d410" goto D410 if "%#*"SELECT REPLACE(prod_name, ' ' , '_') FROM computer WHERE computer_id=%ID%"%"=="Latitude_D410" goto D410 REM If no match is found, exit the script. goto Exit :X300 xcopy .\sysprep\models\x300\Drivers C:\Drivers /E /Y goto Exit :D410 xcopy .\sysprep\models\D410\Drivers C:\Drivers /E /Y goto Exit :D600 xcopy .\sysprep\models\D600\Drivers C:\Drivers /E /Y goto Exit :D610 xcopy .\sysprep\models\D610\Drivers C:\Drivers /E /Y goto Exit :D620 xcopy .\sysprep\models\D620\Drivers C:\Drivers /E /Y goto Exit :D630 xcopy .\sysprep\models\D630\Drivers C:\Drivers /E /Y goto Exit :Exit exit
Optional Step 2: In our environment we use token replacement in our unattended.txt file for the naming of the computer. You can choose to do this or not. I have attached a sample copy of one of our unattended.txt files at the end of this article that shows how to put the token into the txt file. Most of you know how to do token replacement, but for those that do not, create a run script task and put the following in the window:
REM Token Replacement Task for UNATTEND:TXT REM Replacetokens .\Location of unattend.txt file\unattend.txt .\temp\%ID%.inf
Now we need to copy over our unattend.txt, aclient.inp, and our DS client for production, plus actually start the installation. We use the Aclient in our environment, so this will assume the same. In order to accomplish all this, we turn to another script. Now all of these scripts could be included into one long script if you choose to. We prefer to keep them separate for diagnostic purposes. Again, this script is run as a Windows script using the WinPE 32bit Automation environment. With this script, I am not sure you could run it in DOS, due to it calling the WinNT32.exe.
The script is as follows:
REM Script to copy needed files c: cd \ md altiris cd altiris md aclient md files cd files cd \ copy F:\temp\%ID%.inf c:\altiris\files\unattend.txt copy F:\agents\aclient\altiris-aclient-6.9.164.X86.exe C:\altiris\aclient\aclient.exe copy F:\Deploy\unattend\aclient.inp c:\altiris\aclient\aclient.inp c:\i386\winnt32.exe /unattend:c:\altiris\files\unattend.txt /s:c:\i386 /syspart:C: /tempdrive:C: /noreboot
Now since we deployed an image to the computer of the i386 folder on an NTFS drive, it calls all the install files and commands from the local hard drive which is much quicker. Also, the Scripted OS Install included with Altiris calls the winnt.exe file which is considerably slower than the winnt32.exe file. Now depending on how you made your unattend.txt file, the whole install may be automated or you may need to enter a few pieces of information.
This install process only takes about 25 minutes to complete on a Dell D620 laptop with a 2.0Ghz processor and 2gigs of ram. Now if you compress the WinPE Automation environment like in Altiris KB article 22971, you can reduce that time down even further. I've seen reports of reducing the install time down to 15 minutes from start to finish. We have yet to see these speeds in our environment, but then that could be due to our network.
;SetupMgrTag [Data] AutoPartition=1 MsDosInitiated="0" UnattendedInstall="Yes" [Unattended] UnattendMode=FullUnattended OemSkipEula=Yes OemPreinstall=Yes TargetPath=\WINDOWS OemPnPDriversPath="Drivers\NIC;Drivers\Video;Drivers\Audio;Drivers\Cardbus;Drivers\Chipset;Drivers\Modem;Drivers\Blue;Drivers\Wireless;Drivers\TPM;Drivers\Thumb;Drivers\SmartCard" [GuiUnattended] AdminPassword="YOUR LOCAL ADMIN PASSWORD" EncryptedAdminPassword=NO OEMSkipRegional=1 TimeZone=4 OemSkipWelcome=1 [UserData] ProductKey=YOUR PRODUCT KEY FullName="YOUR NAME" OrgName="YOUR COMPANY NAME" ComputerName=%NAME% [Display] Xresolution=1024 YResolution=768 [TapiLocation] CountryCode=1 [RegionalSettings] LanguageGroup=1 SystemLocale=00000409 UserLocale=00000409 InputLocale=0409:00000409 [GuiRunOnce] Command0="c:\altiris\aclient\aclient.exe c:\altiris\aclient\aclient.inp -silent -install -scriptedinstall" [Identification] JoinDomain=YOUR DOMAIN DomainAdmin=YOUR DOMAIN ADMIN ACCOUNT DomainAdminPassword=YOUR DOMAIN ADMIN PASSWORD [Networking] InstallDefaultComponents=Yes
The last thing I would recommend doing is adding a script at the end that runs in production to delete the unattend.txt file that we copied to the hard drive. If you choose not to do this step, be warned that anyone can access this file and see both the local admin password or your domain admin account and password if you choose to have the install add the computer to your domain.
This is kind of a high level overview of what we have done in our enviroment. My next article will dive indepth into what exactly is going on at each step and I will go more into depth regarding the hardware indepenent portion.
Below shows what our console looks like after adding in all the tasks to the job: