Sub topic 12
Unattended installs and image deployment
Installing Windows by hand works for one PC. It does not work for 50 PCs, because every click is a chance for a different result. This chapter covers the two ways technicians remove those clicks: answer files that fill in Setup's questions, and images that copy a finished installation onto new machines. It also covers the network and cloud tools that deliver them.
This chapter assumes you have read the earlier chapters on installation sources, partition styles (GPT and MBR), and install types. You should know what UEFI, a clean install, and a product edition are.
Two ideas: scripted setup and cloned setup
An unattended install runs the normal Windows Setup, but a file supplies the answers. Setup still copies files from the install media and still configures the machine from scratch.
An image deployment skips Setup's file copy. A technician builds one reference PC, captures it as a file, and applies that file to other disks. It is faster, and every machine starts identical.
| Approach | What is repeated on each PC | Speed | Typical use |
|---|---|---|---|
| Manual install | Every Setup screen | Slowest | One-off repair or home PC |
| Unattended install | Full Setup, with answers from a file | Medium | Few PCs, or varied hardware |
| Image deployment | Apply a captured image, then a short first-boot | Fastest | Many identical or similar PCs |
| Cloud provisioning | A stock install, then policy applied from a service | Depends on network | Remote or new-hire devices |
Answer files
An answer file is an XML file that answers Setup's questions: language, disk layout, edition, account names, and whether to join a domain. The traditional name is unattend.xml. If you name it autounattend.xml and place it in the root of the USB install drive, Setup finds it and uses it with no input from you.
Answer files are processed in configuration passes. You do not need to memorize every pass for the exam, but the order shows where each setting takes effect.
windowsPE: runs in the Setup environment. Disk partitioning and the choice of image to install happen here.offlineServicing: applies updates or drivers to the image before first boot.generalize: runs during Sysprep, which is described below.specialize: runs on first boot. Computer name, domain join, and product key are set here.auditSystemandauditUser: optional audit mode, used to install software before the user sees the machine.oobeSystem: runs during the out-of-box experience (OOBE), the screens a new user normally sees. Account creation and privacy choices belong here.
You can write the file by hand, but the supported tool is Windows System Image Manager (WSIM). It is part of the Windows Assessment and Deployment Kit (Windows ADK). WSIM reads a catalog of the install image's settings, so you pick options from a list instead of guessing element names.
The following answer file handles only the windowsPE pass. It wipes disk 0, builds a UEFI/GPT layout, and installs to the main partition.
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE"
processorArchitecture="amd64"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>
</component>
<component name="Microsoft-Windows-Setup"
processorArchitecture="amd64"
publicKeyToken="31bf3856ad364e35"
language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<DiskConfiguration>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order><Type>EFI</Type><Size>260</Size>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>2</Order><Type>MSR</Type><Size>16</Size>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>3</Order><Type>Primary</Type><Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Order>1</Order><PartitionID>1</PartitionID>
<Format>FAT32</Format><Label>System</Label>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Order>2</Order><PartitionID>2</PartitionID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Order>3</Order><PartitionID>3</PartitionID>
<Format>NTFS</Format><Label>Windows</Label><Letter>C</Letter>
</ModifyPartition>
</ModifyPartitions>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>3</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
<UserData>
<AcceptEula>true</AcceptEula>
</UserData>
</component>
</settings>
</unattend>Building and capturing an image
The image workflow has four steps, and the third is where most mistakes happen.
- Install Windows on a reference PC. Add the apps, settings, and updates every machine needs.
- Run Sysprep to generalize it.
- Boot into Windows PE and capture the disk to a WIM file.
- Apply the WIM to each target PC.
Sysprep (System Preparation Tool) strips the details that are unique to one installation: the computer security identifier (SID), the computer name, and cached hardware information. Without this step, every cloned PC would share a SID, which causes problems with domain membership and licensing. Sysprep also sets the PC to run OOBE on its next boot.
C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /shutdownAfter the PC shuts down, do not let it boot into Windows again. Booting would complete OOBE and undo the generalization. Boot from a Windows PE USB drive instead. Windows PE (Preinstallation Environment) is a small, command-line Windows that runs from memory and can work on disks that are not in use.
In Windows PE, drive letters can differ from what you see in normal Windows. Run diskpart and list volume first. The commands below assume the Windows volume appears as C: and a separate storage drive appears as D:.
dism /Capture-Image /ImageFile:D:\images\corp-win11.wim /CaptureDir:C:\ /Name:"Corp Win11 Pro" /Compress:maxDISM (Deployment Image Servicing and Management) is the command-line tool for working with WIM files. A WIM (Windows Imaging Format) file is a file-based image. It stores files, not raw disk sectors, so one WIM can be applied to disks of different sizes. It can also hold several images, each with an index number.
To deploy, boot the target PC into Windows PE, create the partitions (the earlier diskpart pattern from the partitioning chapter), and apply the image. In this example the new Windows partition is W: and the EFI partition is S:.
dism /Apply-Image /ImageFile:D:\images\corp-win11.wim /Index:1 /ApplyDir:W:\
bcdboot W:\Windows /s S: /f UEFIbcdboot writes the boot files to the EFI partition so firmware can start the new copy. The PC then restarts and runs OOBE, or uses an answer file if one is present.
Image types
How much goes into the image changes how you maintain it.
- A thick image contains Windows, drivers, and all applications. Deployment is fast, but the image goes out of date quickly and needs rebuilding often.
- A thin image contains only Windows and base settings. Apps are installed afterward by a tool. Maintenance is easier, but deployment takes longer.
- A hybrid image contains the apps every user needs, and installs the rest afterward.
An image is also tied to the hardware's firmware mode. An image prepared for UEFI/GPT will not boot on a legacy BIOS/MBR disk without changes to the partition layout and boot files.
Delivering over a network
Booting a PC from the network uses PXE (Preboot Execution Environment). The network card asks a server for a boot file, and the server replies with Windows PE. Setup or the image can then be pulled over the network, so no one needs to carry USB drives.
- Windows Deployment Services (WDS) is a Windows Server role. It responds to PXE requests and serves boot images and install images. It can use multicast, which sends one stream to many PCs at once.
- Microsoft Deployment Toolkit (MDT) is a free tool that builds task sequences, which are ordered lists of steps such as partitioning, applying an image, installing drivers, and installing apps. Microsoft has retired MDT, but it still appears in study material and in many existing networks.
- Microsoft Configuration Manager (formerly SCCM) is the large enterprise tool. It deploys operating systems and also manages software and updates over the PC's life.
PXE requires the PC's firmware to have network boot enabled, and the network must offer DHCP, since the PC needs an address before it can find the server.
Cloud and provisioning options
Not every device is ever imaged. Two options skip reimaging entirely:
- Windows Autopilot lets a new PC, set up from the stock Windows image the manufacturer installed, register its hardware ID with a cloud service. When the user signs in during OOBE, the service applies the organization's settings and joins the device to Microsoft Entra ID (formerly Azure AD).
- Provisioning packages are
.ppkgfiles, built with Windows Configuration Designer, that apply settings, certificates, or Wi-Fi profiles to an already installed Windows. They suit small groups of devices.
Both approaches let IT manage a device without wiping the OS it shipped with.
Common failures
| Symptom | Likely cause |
|---|---|
| Setup ignores `autounattend.xml` | Wrong file name, or the file is not in the root of the drive |
| Setup stops on a screen the file should have answered | A required setting is missing, or the file has an XML error |
| Cloned PC fails to boot after applying the image | Boot files were not written with `bcdboot`, or the UEFI/BIOS mode does not match the image |
| Sysprep fails or stops | A Store app was updated for one user and not provisioned for all, or the Sysprep rearm limit was reached |
| PC does not offer network boot | PXE is disabled in firmware, or no DHCP server answers |
| Cloned PCs conflict on the network | The reference PC was not generalized with Sysprep |
Exercise
A technician installs Windows 11 Pro on a reference PC, adds the company's apps, and then captures the disk to a WIM file in Windows PE without running Sysprep. The image is applied to 20 PCs. What problem should the technician expect, and what should have been done?
Show answer
Every PC will carry the reference PC's SID and computer name, because the installation was not generalized. This causes conflicts on the network and problems with domain joining. The technician should have run sysprep.exe /generalize /oobe /shutdown on the reference PC, and then captured the image without booting Windows again.
Exercise
A company wants 200 identical office PCs installed from a central server with no USB drives. Name the boot technology, the Windows Server role that serves the images, and the file that lets Setup run without a person answering screens.
Show answer
The PCs boot with PXE (network boot). Windows Deployment Services (WDS) serves the boot and install images. An answer file, named autounattend.xml and created with Windows System Image Manager, supplies the answers to Setup.