Jul 03, 2020 In this Windows 10 guide, we walk you through the steps to create an autounattend.xml answer file containing all the necessary settings to perform a basic unattended installation of the OS. Currently we are Deploying our Windows 10 Machines with Windows Deployment Services(WDS) with a unattend.xml file for basic settings. From time to time there are machines which won't activate windows automatically(we are using OEM licences). This seems to happen only with new machines on which Windows wasn't activated before. File Save As, name it OOBEUnattend and close Windows Image Maker. Attach this answer file to our image on WDS Console. One of copy of OOBEUnattend file is created under C: RemoteInstall Images Win8ImageGroup Win8ForLabComputers Unattend. This is the actual file that will be used during the image installation. There's a setting in WDS to allow unattend files. Easily enough, you generate one and then apply it to the image. Nothing more complicated than that. This is found under WDS Servers YOURSERVER Install Images YOURCOMPUTERGROUP YOURIMAGE Properties.
The answer file for Setup, typically called Unattend.xml, is used along with the System Preparation tool (Sysprep) to prepare an installation of Windows operating system for duplication or imaging by capturing a customized Windows master image that we can reuse throughout our organization.
The following is an example of running Syprep with the answer file:
Sysprep /generalize /oobe /shutdown /unattend: Unattend.xml
When you run Sysprep /generalize /oobe command, on the next reboot after you run this command, Windows runs the Specialize configuration pass, Plug and Play, and other Setup tasks before Windows starts OOBE. In order to get past the OOBE screens, an unattend file is used to specify values that apply to the 3, 4 and 7 installation passes, such as the names of user accounts, display settings, how to partition disks, the location of the Windows image to install, and the product key to apply. The Sysprep /unattend option in the above command allows us to use an answer file to automate this process and address Generalize, Specialize and OOBE settings.
The following sections in this blog will demonstrate my way to modify a ‘Generic Answer File’ and change the values such as the Computer Name, User Password, Language settings and Product Key. It should be noted that this can be done for any values in the ‘Generic Answer File’ for as long as there are unique strings to search and replace on.
Generic Answer File
The generic answer file described in this blog has certain characteristics.
Firstly, I am using Imagex.exe tool to apply a captured image and therefore the WinPE pass settings are removed from the sample answer file. In addition, I want to use in my example the AdministratorPassword/AutoLogon feature, and since I am deploying into a workgroup, I have to either specify an extra account in the unattend.xml, or the Windows 7 setup will prompt for a user account creation. Since I have enabled the administrator account and specified that user as an extra account, there is no need for creating an extra user which later may have to be deleted.
Secondly, in the example provided here, my generic answer file has the following unique strings:
- ‘TEST-123’
- ‘TEST-ORG’
- ‘TEST-OWNER’
- ‘Pacific Standard Time’
- ‘0409:00000409’
- ‘en-US’
- ‘XXXXX-XXXXX-XXXXX-XXXXX-XXXXX’
- ‘P@ssw0rd’
Picture 1: Generic answers file with unique strings
How Generic Answer File is used?
1. Reference Computer – run Sysprep
The generic file is used in the process of building a master image on a reference computer.
This building process comprises the following stages:
- You install Windows OS on a reference computer.
- After the installation is complete, you boot the computer and install any additional device drivers or applications. Copy the generic answer file into Sysprep directory and name it EditUnattend.xml
- After you update the Windows installation, you run the Sysprep /generalize /oobe /shutdown /unattend: EditUnattend.xml command. The answer file is validated and then cached to the computer’s %WINDIR%panther directory where the name of the answer file must be Unattend.xml.
- After the reference computer shuts down, you can boot to WinPE (in my example: WinPE-DualBootExternalUSBDrive or WinPE-UEFI-BootExternalUSBDrive) to capture the Windows installation with ImageX.exe.
2. Destination Computer – Edit and Apply Answer File
Boot the destination computer by using your bootable Windows PE media or in my example: WinPE-DualBootExternalUSBDrive or WinPE-UEFI-BootExternalUSBDrive. If you use my aforementioned WinPE bootable media, you know that default disk formatting option for a destination computer’s hard drive creates two new partitions: the first one with the letter S: for active and hidden System partition and the second one with the letter W: for a partition labelled Windows. This means when you apply the master image, it will be applied to the Windows partition and therefore the location of the Generic Answer File is: W:WindowsPantherUnattend.xml.
The form shown in the picture 2 – Edit/Update Unattend File by default looks into the W:WindowsPanther folder. When you click ‘Read File’ button the form reads the Unattend.xml file and displays all unique strings.
Picture 2: Edit/Update Unattend File form read the file and displays all unique strings.
The last step as shown in the picture 3 is to change the values in the Unattend .xml file for settings such as the computer name, register organization and owner, product key, etc. To update values in the Unatted.xml file, click the ‘Update File’ button.
Picture 3: change the values in the Unattend .xml file and click ‘Update File’ button.
Note: This is the last step before restarting a destination computer. Once you restart a destination computer the windeploy.exe will finish setup with the changed settings in the Unattend .xml file. This process could be observed if you open and check these log files: setupact.log and setuperr.log, both located in this folder: C:WindowsPantherUnattendGC.
WinPE Bootable Media
I have updated my PowerShell scripts in order to include ‘Edit/Update Sysprep Form’ in two WinPE downloads available from my previous posts about USB bootable media: WinPE – Dual Boot External USB Drive and UEFI Bootable External USB Drive.
The new ‘Apply Image’ portion comprises three tabs as shown in the picture below.
Picture 4: Select MBR or UEFI partition scheme prior to selecting and applying image file.
Picture 5: Select image file and click on ‘Apply’ button to start the process of applying image on the computer’s hard drive.
Note: selecting desired partition scheme and an installation image as shown in the picture 4 and 5 are mandatory steps.
Windows Answer File Generator
Picture 6: Once the image file has been applied to the computer’s hard drive, you can use third tab ‘Sysprep’ to read and update the unattend.xml file.
IMPORTANT: The above Sysprep addition is optional and could be done only in the case that you applied an image previously created with Sysprep /generalize /oobe /shutdown /unattend: EditUnattend.xmlcommand where EditUnattend.xml is a generic answer file. You cannot use this option with a non-sysprepped image or an image that is prepared with a Sysprep command, but the answer file does not have the unique strings to search and replace on.
To download the updated scripts and generic answer file, please go to the site’s download section, expand the Application folder and select: WinPE-Sysprep.
Related Posts
You saw earlier how you could customize the PXE client to minimize your interaction with it.Automating Windows 7 Installation you learned how to useWindows System Image Manager (WSIM) to create answer files to automate Windows PE andthe installation image installation. We have some good news. You can reuse those techniques toautomate the WDS boot image and the deployment of the installation image.
Preparing WSIM
WSIM is the tool that is used to create unattended answer files. It uses a catalog file which is createdfrom the WIM file that will be deployed. The WIM files that arestored on the WDS server do not actually contain any files, thanks to the single-instance storagemechanism. This means you need to export the installation image from WDS so that WSIM can use it to create a catalog.
You can export an installation image by right-clicking it and selecting Export Image. In thisexample, we are exporting the new customized image as D:WimStdWin7UltimateX86.wim.
Automating the Boot Image
There can be up to three boot image unattended answer files on the WDS server, one for eachpossible boot image architecture (x86, x64, or Itanium). These answer files will do everythingthat you would otherwise have to do manually:
- Configure the regionalization for the WinPE pass
- Provide domain credentials to gain access to the WDS server
- Create a partition
- Modify a partition
- Select an image to deploy
To automate the boot image, take the following steps:
- Use WSIM to create an answer file that will be associated with the boot images of your WDS server.
- In the Windows Image pane, right-click and choose Select Windows Image. Open the previouslyexported image. In this case the file is D:WimStdWin7UltimateX86.wim. WSIMwill need to create a catalog file for the image if it is the first time that WSIM has openedit. Note that this process could take a little while.
Sample Unattended Answer Files
You can find a number of sample answer files in the WAIK folder (the default location is C:ProgramFilesWindows AIKSamples). Microsoft has also shared some sample answer files here:http://technet.microsoft.com/library/cc732280(WS.10).aspx
- Choose File → New Answer File to create a new empty answer file, whose contents you can edit in the Answer File pane.
You will be adding a few components from the Windows Image pane to the Answer Filepane and editing the settings in the right-hand pane of WSIM. A possible set of details foran unattended execution of the boot image is shown in Table below. - Validate the answer file (using the Validate Answer File on the Tools menu) and then saveit. You should note that an answer file may still have issues when you use it even if thevalidation shows none. For example, you could enter an invalid product key. The locationfor WDS client answer files is the WDSClientUnattend folder in the RemoteInstallfolder. For example, we will save WDSClientUnattend.xml in D:RemoteInstallWDSClientUnattend.
- You can associate this WDS client unattended answer file with boot images of a specificarchitecture via the properties of the WDS server in the WDS console. Navigate to the Client tab.
- Select the option Enable Unattended Installation.
- Click the Browse button to find and select the unattended answer file(s) in the WDSClientUnattend folder.
'Boot image unattended answer file details'
Component | Setting Name | Setting Value |
---|---|---|
x86_Microsoft-Windows-International- Core-WinPE_neutral | InputLocale | en-us |
x86_Microsoft-Windows-International- Core-WinPE_neutral | SystemLocale | en-us |
x86_Microsoft-Windows-International- Core-WinPE_neutral | UILanguage | en-us |
x86_Microsoft-Windows-International- Core-WinPE_neutral | UILanguageFallback | en-us |
x86_Microsoft-Windows-International- Core-WinPE_neutral | UserLocale | en-us |
x86_Microsoft-Windows-International- Core-WinPE_neutralSetupUILanguage | UILanguage | en-us |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDisk | DiskID | 0 |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDisk | WillWipeDisk | True |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDiskCreatePartition | Extend | True |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDiskCreatePartition | Order | 1 |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDiskCreatePartition | Type | Primary |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDiskModifyPartition | Active | True |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDiskModifyPartition | Extend | True |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDiskModifyPartition | Format | NTFS |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDiskModifyPartition | Label | Windows |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDiskModifyPartition | Letter | C |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDiskModifyPartition | Order | 1 |
x86_Microsoft-Windows-Setup_neutral DiskConfigurationDiskModifyPartition | PartitionID | 1 |
x86_Microsoft-Windows-Setup_neutral WindowsDeploymentServicesImageSelectionInstallImage | Filename | Install.wim |
x86_Microsoft-Windows-Setup_neutral WindowsDeploymentServicesImageSelectionInstallImage | ImageGroup | Windows 7 x86 Ultimate Edition |
x86_Microsoft-Windows-Setup_neutral WindowsDeploymentServicesImageSelectionInstallImage | ImageName | Customized Windows 7 Ultimate x86 |
x86_Microsoft-Windows-Setup_neutral WindowsDeploymentServicesImageSelectionInstallTo | DiskID | 0 |
x86_Microsoft-Windows-Setup_neutral WindowsDeploymentServicesImageSelectionInstallImage | PartitionID | 1 |
x86_Microsoft-Windows-Setup_neutral WindowsDeploymentServicesLoginCredentials | Domain | deploy.com |
x86_Microsoft-Windows-Setup_neutral WindowsDeploymentServicesLoginCredentials | Password | <password of user> |
x86_Microsoft-Windows-Setup_neutral WindowsDeploymentServicesLoginCredentials | Username | <username of user> |
You have now configured the WDS client to work without any human interaction.
Automating Image Installation
The previous section described how to get your boot image to run in an unattended manner.This solution would choose which installation image would be deployed. The installation willexecute as normal, requiring some human interaction. You can use WSIM once again to createan answer file for the operating system installation.
Wds Uattend File Generator Software
The big difference is that you will not need to add the Windows PE passcomponents. That's because this pass is handled by the WDS client unattended answer file.Once you have created the answer file, you will need to save it on the WDS server. For example,you could save it in a new folder as D:RemoteInstallInstallUnattendCustomized Windows 7 Ultimate x86.xml.
You can associate this answer file with your desired installation images by browsing to aninstallation image and opening its properties. Select the option AllowImage To Install In Unattended Mode. You will then click Select File and browse to and selectthe answer file you have saved to the WDS server. From now on, any deployments of this installationimage will be controlled by this answer file. It will require no more human interaction if you have configured it correctly.