How to Set Up Microsoft Deployment Toolkit (MDT) on Windows Server 2012 R2
Microsoft Deployment Toolkit (MDT) is a free Microsoft solution that extends Windows Deployment Services to provide a fully automated, zero-touch operating system and application deployment framework. MDT uses task sequences — ordered lists of steps — to deploy Windows, install applications, apply patches, configure settings, and join domains, all without operator involvement. On Windows Server 2012 R2, MDT integrates with WDS to provide PXE-based deployment, or can deploy to machines via bootable USB drives in remote environments. This guide walks through the complete MDT setup including installing the required components, creating a deployment share, building a customized boot image, creating a task sequence, and performing a test deployment.
Prerequisites
- Windows Server 2012 R2 with administrator access
- Windows Deployment Services (WDS) installed and configured (see WDS tutorial in this series)
- Windows ADK (Assessment and Deployment Kit) for Windows 8.1
- At least 50 GB free disk space for the deployment share
- Windows Server installation ISO files for the images to be deployed
- Active Directory domain (recommended)
Step 1: Install Windows ADK
MDT requires the Windows ADK to build custom WinPE boot images. For WS2012 R2, install the Windows ADK for Windows 8.1:
Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=323507" -OutFile "C:Tempadksetup.exe"
Start-Process -FilePath "C:Tempadksetup.exe" -ArgumentList `
"/quiet /norestart /features OptionId.DeploymentTools OptionId.WindowsPreinstallationEnvironment OptionId.UserStateMigrationTool" `
-Wait -PassThru
Verify installation:
Test-Path "C:Program Files (x86)Windows Kits8.1Assessment and Deployment KitDeployment Tools"
Step 2: Install Microsoft Deployment Toolkit
Download and install MDT 2013 Update 2 (the latest version compatible with WS2012 R2 as the deployment server):
Invoke-WebRequest -Uri "https://download.microsoft.com/download/3/3/9/339BE62D-B4B8-4956-B58D-73C4685FC492/MicrosoftDeploymentToolkit_x64.msi" -OutFile "C:TempMDT.msi"
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i C:TempMDT.msi /quiet /norestart" -Wait -PassThru
Write-Host "MDT installed"
Step 3: Create a Deployment Share
A deployment share is the central repository for MDT — it contains operating system images, application installers, drivers, and task sequences. Create it using the MDT PowerShell module:
Import-Module "C:Program FilesMicrosoft Deployment ToolkitbinMicrosoftDeploymentToolkit.psd1"
New-Item -ItemType Directory -Path "D:MDTShare" -Force
New-PSDrive -Name "DS001" -PSProvider MDTProvider `
-Root "D:MDTShare" `
-Description "MDT Production Deployment Share" `
-NetworkPath "\$env:COMPUTERNAMEMDTShare" `
-Verbose | Add-MDTPersistentDrive
# Share the directory
New-SmbShare -Name "MDTShare" -Path "D:MDTShare" -FullAccess "Everyone" -ReadAccess "Domain Computers" -ErrorAction SilentlyContinue
Step 4: Import an Operating System
Import the Windows Server 2012 R2 installation files from a mounted ISO into the MDT deployment share:
$ISOPath = "C:ISOsWindowsServer2012R2.iso"
Mount-DiskImage -ImagePath $ISOPath
$DriveLetter = (Get-DiskImage -ImagePath $ISOPath | Get-Volume).DriveLetter
Import-MDTOperatingSystem -Path "DS001:Operating Systems" `
-SourcePath "${DriveLetter}:" `
-DestinationFolder "WS2012R2" `
-Verbose
Dismount-DiskImage -ImagePath $ISOPath
Write-Host "Operating system imported"
Step 5: Import Applications
MDT can install applications silently as part of a task sequence. Import common applications you want deployed with every new server:
# Import 7-Zip as a managed application
$AppSourceDir = "C:AppSources7-Zip"
New-Item -ItemType Directory -Path $AppSourceDir -Force
Invoke-WebRequest -Uri "https://www.7-zip.org/a/7z2406-x64.msi" -OutFile "$AppSourceDir7zip.msi"
Import-MDTApplication -Path "DS001:Applications" `
-Enable "True" `
-Name "7-Zip 24.06 (x64)" `
-ShortName "7-Zip" `
-Version "24.06" `
-Publisher "Igor Pavlov" `
-Language "en-US" `
-CommandLine "msiexec /i 7zip.msi /quiet /norestart" `
-WorkingDirectory ".Applications7-Zip 24.06 (x64)" `
-ApplicationSourcePath $AppSourceDir `
-DestinationFolder "7-Zip 24.06 (x64)"
Step 6: Create a Task Sequence
A task sequence defines the ordered deployment workflow. Create a standard server build task sequence:
$OS = Get-Item "DS001:Operating SystemsWindows Server 2012 R2 SERVERSTANDARD in WS2012R2 install.wim"
Import-MDTTaskSequence -Path "DS001:Task Sequences" `
-Name "Deploy WS2012R2 Standard" `
-Template "Server.xml" `
-Comments "Standard Windows Server 2012 R2 deployment with baseline applications" `
-ID "WS2012R2-STD" `
-Version "1.0" `
-OperatingSystemPath "DS001:Operating SystemsWindows Server 2012 R2 SERVERSTANDARD in WS2012R2 install.wim" `
-FullName "Administrator" `
-OrgName "Your Organization" `
-HomePage "about:blank" `
-Verbose
Write-Host "Task sequence created"
Step 7: Configure the CustomSettings.ini File
The CustomSettings.ini file controls MDT deployment behavior and eliminates installation wizard prompts for a fully automated deployment:
$CustomSettings = @"
[Settings]
Priority=Default
Properties=MyCustomProperty
[Default]
OSInstall=YES
SkipCapture=YES
SkipAdminPassword=NO
SkipProductKey=YES
SkipComputerBackup=YES
SkipBitLocker=YES
SkipBDDWelcome=YES
SkipDeployReadiness=YES
SkipApplications=YES
SkipTaskSequence=NO
SkipComputerName=NO
SkipDomainMembership=NO
SkipUserData=YES
SkipLocaleSelection=YES
SkipTimeZone=YES
SkipSummary=YES
SkipFinalSummary=YES
SkipWizard=YES
TimeZoneName=UTC
KeyboardLocale=0409:00000409
UILanguage=en-US
UserLocale=en-US
SystemLocale=en-US
JoinDomain=DOMAIN
DomainAdmin=domainsvc_mdt_domain_join
DomainAdminPassword=DomainJoinPassword!
MachineObjectOU=OU=Servers,DC=domain,DC=local
AdminPassword=P@ssw0rdNew!
"@
Set-Content -Path "D:MDTShareControlCustomSettings.ini" -Value $CustomSettings -Encoding ASCII
Step 8: Update the Deployment Share and Generate Boot Image
After adding operating systems, applications, and configuring settings, update the deployment share to regenerate the WinPE boot image with the current drivers and customizations:
Update-MDTDeploymentShare -Path "DS001:" -Force -Verbose
This process typically takes 10-20 minutes as it constructs the WinPE environment. After completion, the boot images are located at D:MDTShareBootLiteTouchPE_x64.wim.
Import the new boot image into WDS to make it available for PXE boot:
Import-WdsBootImage -Path "D:MDTShareBootLiteTouchPE_x64.wim" `
-NewImageName "MDT LiteTouch WinPE x64" `
-NewDescription "MDT automated deployment boot image"
Write-Host "MDT boot image imported into WDS"
Step 9: Test Deployment in a VM
Create a test VM, configure it to boot from the network (PXE), and power it on. The machine should boot the WinPE environment, connect to the MDT deployment share, present the task sequence selection wizard (or auto-select if SkipTaskSequence=YES), and begin the fully automated deployment. Total deployment time is typically 20-40 minutes for Windows Server 2012 R2 including application installation.
Summary
Microsoft Deployment Toolkit is now configured on Windows Server 2012 R2, providing a complete zero-touch deployment platform. The setup includes the Windows ADK for WinPE build support, an MDT deployment share containing operating system images and applications, a customized task sequence for automated WS2012 R2 deployment, a CustomSettings.ini that suppresses all wizard prompts and automates domain joining, and WDS integration for PXE boot delivery. New servers can now be provisioned from bare metal to a domain-joined, fully configured state entirely automatically, dramatically reducing the time and manual effort required for server builds.