How to Set Up Windows Deployment Services (WDS) on Windows Server 2012 R2
Windows Deployment Services (WDS) is a server role that enables network-based installation of Windows operating systems to bare-metal machines, virtual machines, and servers that support PXE (Preboot Execution Environment) boot. WDS eliminates the need for physical installation media by serving boot images and install images over the network using TFTP and PXE, making it foundational for automated server provisioning, bare-metal recovery, and large-scale deployments. This guide walks through installing and configuring WDS on Windows Server 2012 R2, adding boot and install images, configuring PXE responses, and automating deployments using unattend answer files.
Prerequisites
- Windows Server 2012 R2 with static IP address
- Active Directory domain membership (WDS works best in a domain environment)
- A DHCP server on the network (can coexist on the same server or a separate server)
- At least 40 GB of free disk space on a volume dedicated to WDS images
- Administrator access and the WDS management tools
- Windows Server or Windows installation ISO files for the images you want to deploy
Step 1: Install the WDS Role
Install-WindowsFeature -Name WDS -IncludeManagementTools
Install-WindowsFeature -Name WDS-Transport, WDS-Deployment
Verify the role installed correctly:
Get-WindowsFeature -Name WDS* | Select-Object Name, InstallState
Step 2: Initialize WDS with wdsutil
Configure WDS with the remote installation folder path. Use a dedicated volume for WDS content to prevent it from filling the system volume:
New-Item -ItemType Directory -Path "D:RemoteInstall" -Force
wdsutil /Initialize-Server /RemInst:"D:RemoteInstall" /Authorize
# Configure PXE response policy: respond to known clients and unknown clients
wdsutil /Set-Server /AnswerClients:All
# Configure DHCP integration if DHCP is on the same server
wdsutil /Set-Server /UseDhcpPorts:Yes /DHCPOption60:Yes
The /Authorize flag authorizes the WDS server in Active Directory DHCP if your domain requires it. The /AnswerClients:All setting tells WDS to respond to all PXE clients; change to Known to only respond to pre-staged clients (more secure for production environments).
Step 3: Mount the Windows ISO and Add Boot Image
The boot image (boot.wim) is the Windows PE environment that loads over the network and initiates the installation process. Extract it from a Windows Server installation ISO:
# Mount the ISO file (requires WS2012 R2 - Mount-DiskImage is available)
$ISOPath = "C:ISOsWindowsServer2012R2.iso"
Mount-DiskImage -ImagePath $ISOPath -PassThru
# Get the drive letter of the mounted ISO
$DriveLetter = (Get-DiskImage -ImagePath $ISOPath | Get-Volume).DriveLetter
Write-Host "ISO mounted at $DriveLetter`:"
# Add the boot image to WDS
$BootWimPath = "${DriveLetter}:sourcesboot.wim"
Import-WdsBootImage -Path $BootWimPath -NewImageName "Windows Server 2012 R2 Setup" -NewDescription "Boot environment for WS2012R2 installation"
Write-Host "Boot image added successfully"
Step 4: Add the Install Image
The install image (install.wim) contains the actual operating system that gets deployed to the target machine. Create an image group and add the install image from the same ISO:
# Create an image group to organize install images
New-WdsInstallImageGroup -Name "Windows Server 2012 R2"
# Add the install image (this contains all editions in a single WIM)
$InstallWimPath = "${DriveLetter}:sourcesinstall.wim"
# View available editions in the WIM
Get-WindowsImage -ImagePath $InstallWimPath | Select-Object ImageIndex, ImageName
# Add only the edition you want to deploy (index 2 = Datacenter, index 4 = Standard with GUI)
Import-WdsInstallImage -Path $InstallWimPath `
-ImageGroup "Windows Server 2012 R2" `
-ImageName "Windows Server 2012 R2 SERVERSTANDARD" `
-NewImageName "WS2012R2 Standard with GUI" `
-NewDescription "Windows Server 2012 R2 Standard - Full Desktop Experience"
Write-Host "Install image added successfully"
Unmount the ISO after extracting the images:
Dismount-DiskImage -ImagePath $ISOPath
Step 5: Create an Unattend Answer File
An unattend.xml answer file automates the installation process, eliminating prompts for language, time zone, administrator password, and disk partitioning. Create a basic answer file:
$UnattendXml = @'
en-US
en-US
en-US
en-US
0
true
1
Primary
true
1
1
true
NTFS
true
true
D2N9P-3P6X9-2R39C-7RTCD-MDVJX
Never
true
true
true
UTC
P@ssw0rdAdmin1!
true
'@
New-Item -ItemType Directory -Path "D:RemoteInstallWdsClientUnattend" -Force
Set-Content -Path "D:RemoteInstallWdsClientUnattendWS2012R2-Unattend.xml" -Value $UnattendXml -Encoding UTF8
Step 6: Associate the Answer File with the Boot Image
Set-WdsBootImage -Architecture X64 -ImageName "Windows Server 2012 R2 Setup" -UnattendFile "D:RemoteInstallWdsClientUnattendWS2012R2-Unattend.xml"
Step 7: Configure PXE Boot Response Policy
# Configure delay before PXE response (gives DHCP time to respond first)
wdsutil /Set-Server /PxePromptPolicy /New:OptOut /Known:OptOut
# Set the boot program for UEFI and BIOS clients
wdsutil /Set-Server /BootProgram:bootx64wdsnbp.com /Architecture:X64
wdsutil /Set-Server /N12BootProgram:bootx64wdsnbp.com /Architecture:X64
Step 8: Verify WDS Configuration
Get-WdsServer
Get-WdsBootImage | Select-Object ImageName, Architecture, ImageSize
Get-WdsInstallImage | Select-Object ImageName, ImageGroup, Architecture
# Check the WDS service status
Get-Service WDSServer | Select-Object Name, Status, StartType
Summary
Windows Deployment Services is now configured on Windows Server 2012 R2 as a PXE-based OS deployment server. The setup includes the WDS role, dedicated image storage, imported boot and install images from a Windows Server ISO, an automated unattend answer file that performs fully unattended OS installations, and PXE response configuration. Any machine on the network configured to boot from the network will receive the WinPE boot environment and can automatically install Windows Server 2012 R2 without any operator interaction. Combined with MDT, this WDS server can scale to deploying fully configured servers with applications, patches, and domain membership in a single automated workflow.