I was asked recently to build several Windows 7 32-bit machines for user application testing. Since we don’t currently have an Win7 x86 image we would not be able to use our normal ConfigMgr Lite Touch build process. These would need to be hand built from Windows media. Rather than repetitively clicking through the setup steps on each machine I wanted to automate the entire process.
What I decided to do was create an answer file that would perform a fully unattended Windows installation. An answer file is an XML file where you specify the setup options that will be answered during installation (including disk partition, user accounts, product key and much more).
In the steps below I will show you how to create and validate an answer file and then how to use it to build a Windows machine. Here is a copy of the autounattend.xml file that I created in this post. Right-click the link and select Save Link As to download the file.
- Download and install Windows Automated Installation Kit (WAIK) for Windows 7.
Note: If you plan on creating both x86 and x64 answer files I suggest you install WAIK on a 32 bit machine. This will allow you to create both x86 and x64 answer files. You are only able to create x64 answer files from a x64 version of WAIK.
- You’ll first need to copy the Windows image file to your local computer. Insert the Windows 7 product DVD and browse to the Sources folder. Copy the install.wim file to your local machine.
- Launch Windows SIM (System Image Manager) from the Start Menu.
- From the File menu click Select Windows Image. Browse to the install.wim file you copied in the previous step. Click Open.
- When prompted to create a catalog file (.clg), click yes. The catalog file displays the available components and packages used to build and answer file.
- Click Yes to the UAC warning.
- It may take several minutes to create the catalog file.
- Click File, New Answer File.
- Notice how the answer file is divided into the different phases of the Windows setup. These are called configuration passes. For more details on each pass, you can reference How Configuration Passes Work.
- Next we need to add the necessary components from the image catalog to the appropriate configuration pass. From the Windows Image pane (on the lower left), expand the list of components and add each of these components to your answer file by right-clicking and selecting the appropriate configuration pass. Then set the value for each setting as listed below.
x86_Microsoft-Windows-International-Core-WinPE_neutral –> Add to Pass 1 windowsPE
InputLocale = en-US
SystemLocale = en-US
UILanguage = en-US
UserLocale = en-US
x86_Microsoft-Windows-Setup_neutral –> Add to Pass 1 windowsPE
DiskConfiguration -> WillShowUI = OnError
User Data -> AcceptEula = True
Right-click DiskConfiguration and choose Insert new disk
DiskID = 0
WillWipeDisk = True
Right-click the CreatePartitions component to choose Insert New CreatePartition
Extend = false
Order = 1
Size = 10000
Type = Primary
Right-click ModifyPartitions and choose Insert New ModifyPartition
Active = True
Extend = True (this will extend the partition to use all free disk space)
Format = NTFS
Letter = C
Order = 1
Partition ID = 1
InstallImage -> OSImage -> WillShowUI = OnError
InstallImage -> OSImage -> Install To -> diskID = 0
InstallImage -> OSImage -> Install To -> PartitionID = 1
x86_Microsoft-Windows-Deployment_neutral –> Add to Pass 4 specialize
Right-click RunSynchronous to Add RunSynchronousCommand
Order = 1
Path = net user administrator /active:yes
x86_Microsoft-Windows-Shell-Setup_neutral –> Add to Pass 4 specialize
Computername = PicnicBasket (enter your own value)
x86_Microsoft-Windows-Shell-Setup_neutral –> Add to Pass 7 oobeSystem
Registered Owner = Yogi Bear (enter your own value)
TimeZone = Central Standard Time
OOBE -> HideEULAPage = True
NetworkLocation = Work
ProtectYourPC = 1
UserAccounts -> AdministratorPassword -> Value = P@ssw0rd1 (enter your own value)
Note: You are able to hide the password in the answer file by selecting Tools, Hide Sensitive Data.
Right-Click LocalAccounts and click Insert New LocalAccount
Description = Local Administrator
DisplayName = Administrator
Group = Administrators
Name = Administrator
Password -> Value = P@ssw0rd1 (enter your own value)
- Validate answer file by selecting Tools, Validate Answer File. Review the errors and make changes as necessary. You may see several warnings for settings that have been added to the answer file but have not been configured, you can ignore these warnings.
- Click File, Save Answer File and name it autounattend.xml.
- Copy the autounattend.xml file to the root of any external media. For this example I will copy it to a USB flash drive.
- Insert the USB flash drive into the computer you plan to image. Then boot the computer using the Windows 7 product DVD. Windows setup will search the root of all media for an answer file. If it finds one it will use the settings in the answer file during the installation.
- If you set up your answer file correctly the Windows setup process will run start to finish without requiring any user input. If you find the setup prompts for any input, go back to your answer file and verify you provided the necessary values.