Unattended install Windows 10 using Windows Deployement Service on Win Server 2012 R2

Posted: October 30, 2015 in Windows Server

I installed WDS using PowerShell:

get-windowsfeature wds* | install-windowsfeature

In this post i configured DHCP scope.New client machines will use addresses from this scope.

To configure WDS,from server manager click WDS on the left and right click on server name on the left

Untitled

In WDS console,rught click on server name and choose configure server

Untitled

Check intergated with Active Directory

Untitled

Select location for boot and image files

Untitled

Because WDS and DHCP are on the same machine,i checked both check-boxes

Untitled

Decide if you want to respond to computers objects first created in AD (prestaged) or to any computers on which F12 is pressed (unknown)

Untitled

After you click Next,WDS service will start.Right click again on server name in WDS console,click AD DS tab to choose naming convention and where to store domain joined clients.Because for me domain join didn’t work,these settings weren’t neccessary.

Untitled

On boot tab,we can set if clients can download boot image from WDS without need to press F12 button

Untitled

Sysprepping referenced computer

Although i specified domain username/password in xml file,i couldn’t get win 10 to be domain member,i tried many,many times,with no success

Error [0x0b003a] WDS <GetNameInfo failed; status 0x8007276d>[gle=0x0000276d]</>

To overcome this issue i had to add PowerShell script to  c:\windows\setup\scripts folder

Untitled21

After last restart in installation process,Windows will serach for any script in Scripts folder and if find any,it will be executed

SetupComplete.cmd calls jd.ps1 powershell script

powershell.exe -nologo -executionpolicy bypass -noprofile -file "C:\Windows\Setup\Scripts\jd.ps1"

By default,powershell doesn’t allows running custom PS scripts,that’s why we need to bypass it

ps1.ps joins computer to domain

$domain = "test.com"
$password = "Mypass" | ConvertTo-SecureString -asPlainText -Force
$username = "$domain\administrator"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
$ouPath="OU=workstations,DC=test,DC=com"
add-computer -Credential $credential -DomainName $domain -OUPath $ouPath -restart -force

Now we need to capture image from this client computer (so that content of scripts folder can be available to all newly deployed computers)  and upload it to WDS server so it can be available for deployement.We also can install all neccesarry applications needed for users,and adjust system to comply to company policies.I didn’t join reference computer to domain.

SYSPREP is a tool that allows an admin to create a custom install OS image with all the necessary programs preinstalled.

Sysprep is located on %Windir%\System32\Sysprep

Untitled21

SYSPRER removes system-specific information from a Windows image, including the computer security identifier (SID) which allows you to transfer the image to other systems

Untitled1

After you click OK,SYSPRER will remove system-specific info from the system and shutdown it

Creating Capture image

Capture image is type of boot image that we boot a client computer into to capture the operating system as a .wim file.We create capture image from boot image (located in setup DVD in source folder)-the Microsoft Windows Preinstallation Environment (Windows PE) image.

Windows Preinstallation Environment (Windows PE) is a minimal Win32 operating system with limited services, built on the Windows kernel. It is used to prepare a computer for Windows installation, to copy disk images from a network file server, and to initiate Windows Setup.

In WDS console,right click on Boot Image-Add Boot image

Untitled2

browse to install DVD-source folder-and click Next

Untitled3

Right click on just imported boot image and select create capture image

Untitled4

Browse to uploaded boot image (partition set during WDS initial configuration\Boot\X64\Images

Untitled5

Type image and file name

Untitled6

Right click anywhere on the right and choose Add Boot  image

Untitled7

Select image created in previous step

Untitled8

Give it name and click next

Untitled9

Now,power on referenced computer (on which we run Sysprep)  press F12 and choose captured image we’ve just created

Untitled10

Untitled11

Untitled12

In name and location,browse somewhere on C disk and give image descriptive name,check upload image to WDS,
by default ImageGroup1 is created and click next,image of referenced client computer,represented in wim file will be uploaded to WDS.

Untitled13

After upload completes (time depends on client disk size and network bandwith),in WDS console rigtr click
Install image and choose Add install image

Untitled14

Captured image is stored in Images\ImageGroup folder

Untitled15

Now,when we have imported image of client computer,we can create xml file which would ensure automatic Win10

installation.Download Windows Assesement and Deployement Kit to WDS http://download.microsoft.com/download/8/1/9/8197FEB9-FABE-48FD-A537-7D8709586715/adk/adksetup.exe

Select Deployement Tools

Untitled14

In C:\Program Files (x86)\Windows Kits\10\Assesement and Deployement Kit\Deployement Tools\Wsim folder,run imgmgr.exe file

Untitled14

Windows System Image Manager opens,using this tool,we’ll create unattended.xml files needed for automatic Windows 10 installation.

Windows System Image Manager (WSIM) uses Windows image (.wim) files and catalog (.clg) files to display the available components and packages that can be added to an unattended answer file. Windows images and catalog files contain configurable settings that you can modify once the component or package is added to an answer file.

I tried to create catalog file from captured image and WSIM thrown an “unspecified error”,so i used default wim file from Win 10 install media

I had to copy install.wim from DVD to local disk

In WSIM click file-Select windows image

Untitled14

Browse to install.wim (copied from DVD),you’ll be promted to create catalog file

A “catalog” file is a binary file that lists the state of all the settings and packages in a Windows image. When a catalog is created, it queries the Windows image for a list of all the settings in that image

Untitled14

After creating catalog file,click New Answer File

Untitled14

Expand Conponents right click amd64_Microsoft-Windows-International-Core-WinPE_10.0.10240.16384_neutral

and select Pass1 WindowsPE (used in Windows Preinstallation environment)

Untitled14

Here we set Input,System,Language and User locale

Untitled14

Untitled14

Now select Microsoft-Windows-Setup_10.0.10240.16384_neutral and again select Pass 1 WindowsPE

Untitled14

In this stage we configure HDD-partition,label and letter

Untitled14

Untitled14

Untitled14

Under Windows deployement service (part of Microsoft-Windows-Setup_10.0.10240.16384_neutral)we specify image name,image group and wim filename

Untitled14

On which disk and partition to install wim image

Untitled14

And WDS credentials

Untitled14

Untitled

select amd64_Microsoft-Windows-Shell-Setup_10.0.10240.16384_neutral and choose pass 4 specialize (varius system desktop related settings)

Untitled
Save xml file to folder where images are stored.

In WDS console,right click on WDS server-Client properties and browse to xml file we just created

Untitled14

Win10.xml

<?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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>en-us</UILanguage>
</SetupUILanguage>
<InputLocale>en-us</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UILanguageFallback>en-us</UILanguageFallback>
<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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DiskConfiguration>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Extend>true</Extend>
<Order>1</Order>
<Type>Primary</Type>
</CreatePartition>
</CreatePartitions>
<DiskID>0</DiskID>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Format>NTFS</Format>
<Label>SYSTEM</Label>
<Letter>C</Letter>
<Order>1</Order>
<PartitionID>1</PartitionID>
</ModifyPartition>
</ModifyPartitions>
</Disk>
</DiskConfiguration>
<WindowsDeploymentServices>
<Login>
<Credentials>
<Domain>test</Domain>
<Password>password</Password>
<Username>administrator</Username>
</Credentials>
</Login>
<ImageSelection>
<InstallImage>
<Filename>w10-(2).wim</Filename>
<ImageGroup>ImageGroup1</ImageGroup>
<ImageName>w10_custom_image</ImageName>
</InstallImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
</ImageSelection>
</WindowsDeploymentServices>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<TimeZone>Central Europe Standard Time</TimeZone>
<ProductKey>NPPR9-FWDCX-D2C8J-H872K-2YT43</ProductKey>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:c:/users/administrator/desktop/win10.wim#Windows 10 Enterprise" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

Create new XML file

Select amd64_Microsoft-Windows-International-Core_10.0.10240.16384_neutral and choose

pass 7 oobeSystem: In this configuration pass, settings are applied before the LogOn screen appears

Untitled14

Untitled14

Again,select amd64_Microsoft-Windows-Shell-Setup_10.0.10240.16384_neutral and choose

pass 7 oobeSystem

Untitled14

Here you can set Time Zone

Untitled14

Untitled14

Setting Local Admin Account

Untitled14

Untitled14

Save file and assign it to captured image

Untitled16

Untitled17

deploy.xml

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-us</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UILanguageFallback>en-us</UILanguageFallback>
<UserLocale>en-us</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>UABhAHMAcwB3ADAAcgBkADAANgBQAGEAcwBzAHcAbwByAGQA</Value>
<PlainText>false</PlainText>
</Password>
<Description>machine admin</Description>
<DisplayName>admin</DisplayName>
<Group>administrators</Group>
<Name>admin</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideLocalAccountScreen>true</HideLocalAccountScreen>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<ProtectYourPC>1</ProtectYourPC>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
</OOBE>
<TimeZone>Central Europe Standard Time</TimeZone>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:c:/users/administrator/desktop/win10.wim#Windows 10 Enterprise" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

Fire off workstation and installation should proceed without user intervention

Comments
  1. Hey,

    Is it possible to deploy Windows 10+ unattended file with WDS installed on a Server 2008R2 server ?

    Sincerely,

    Nick H

    Like

  2. Achim says:

    Hey,

    what is to do that I can typing the ComputerName manuell in, by the deployment?

    Regards,

    Achim

    Like

    • dragan979 says:

      Change your WDS Server’s PXE settings to prompt for administrator approval for all known and unknown PCs
      This will then generate a request ID when the PC is booted via F12

      name and approve the PC in WDS via the pending devices container.

      Like

  3. Dragan,

    Thanks alot!

    Sincerly,

    Nick

    Like

  4. Dragan,

    Do you know how to enable the build in administrator account for Windows 10 unattended file?

    Sincerly,

    Nick

    Like

  5. dragan979 says:

    In deploy.xml there is a section to set local admin,but for me,it didn’t work

    Like

    • Jennifer says:

      For built in administrator account, Add amd64_Microsoft-Windows-Deployment-neutral to the specialize pass.
      Add a RunSynchronous Command.
      Order :1
      Path: net user administrator /active:yes

      and password.

      Liked by 1 person

  6. Tufail Shah says:

    Plz update your windows 10 boot.wim file to windows 10 new build 1607. it will certainly fix joining domain issue. no need for the script any more after this anniversary update. Tested 100% working.

    Liked by 1 person

  7. Tufail Shah says:

    Hi Dragan, can u plz add domain join code with administrator (access user name and password), also to add machine to OU.
    my xml file is below, its joining to doamin and putting mahcine to right OU. but i am getting an error while logging in with local user. “You’ve been signed in with a temporary profile”.
    but with your file with joining to domain there is no errro.
    can u plz put joining domain code in a proper way in your file and send me. also plz add code for computer name which is missing in your file.
    my file is as below.

    *
    %TIMEZONE%
    Al Tamimi & Company
    ATCOVDI

    domain.com
    password
    administrator

    domain.com
    OU=Windows 10,OU=ThinClients,OU=ATCO Desktops,OU=ouname,DC=domain,DC=com

    en-us
    en-us
    en-us
    en-us
    en-us

    true

    true
    localthinuser

    true

    Local thin client user
    localthinuser
    Administrators
    localthinuser

    %TIMEZONE%
    Al Tamimi & Co
    ATCO

    true
    Work
    true
    1

    Like

  8. Tufail Shah says:

    *
    %TIMEZONE%
    Al Tamimi & Company
    ATCOVDI

    domain.com
    password
    administrator

    domain.com
    OU=Windows 10,OU=ThinClients,OU=ATCO Desktops,OU=ouname,DC=domain,DC=com

    en-us
    en-us
    en-us
    en-us
    en-us

    true

    true
    localthinuser

    true

    Local thin client user
    localthinuser
    Administrators
    localthinuser

    %TIMEZONE%
    Al Tamimi & Co
    ATCO

    true
    Work
    true
    1

    Like

  9. Arris says:

    Thanks lot for this, really helpful to give a good start. pitty MS decided to encrypt their OEM ISO’s, so it takes a bit more effort to get a working install.wim file to work with but doable. Great work!

    Like

  10. Jeez. It’s been a long time I actually pulled out a piece of printer paper to take notes on a blog post lol. Thanks for this. You’ve earned yourself a new reader!

    Like

  11. Jonny says:

    Hi,

    i have one question… when i create the VM with Windows 10 OS and sysprep the machine, will the drivers of the virtualization tool be in the sysprepped image? Because when i deploy the image with the drivers to machines, didnt cause that problems with new drivers from the Client?

    greetings,

    Jonny

    Like

  12. Michael says:

    thanks for this, I benified a lot from it.
    but domain joining is possible. I use wds prestage, and in specialize pass, set computername equals %computername%, and add Microsoft-Windows-UnattendedJoin to specialize pass. you can try it also

    Liked by 1 person

    • dragan979 says:

      Thanks Michael, in one of previous comments it’s also stated, at the time i wrote post (2 years ago), with current win 10 version at that time it hasn’t been possible

      Like

  13. Tom says:

    Great write up. Thank you. Clarified a number of issues I was having. Can you help with the following:
    Did you use win 10 VM’s for both the “technicians” machine and the “capture” machine.
    Do you create snapshots to go back to if you have to redo some steps?
    How do you deal with drivers when deploying to physical machines?

    Like

  14. My hat is down for a such tutorial. I am planning to introduce WDS and deploy apps via WDS.
    As I am in the UK, there is a way for the language to be everything in UK language pack ?

    Many thanks

    Like

  15. sunny_fierro says:

    what i should include if i want UEFI x64?

    Liked by 1 person

  16. I must say I followed this article and all worked for me except deployment services auto selecting the install image.. Although I haven’t messed around much with it.. I don’t mind selecting my image from the list. The major challenge for me was the partitioning of the disk. I guess this would work if your machines have new drives in without any partitions but for me it failed. After playing around a bit I got it to work but also editing the “WillWipeDisk” option in the partition settings..

    Liked by 1 person

  17. Virgil Edwards says:

    I have my unattend file set up correctly, but when I launch the unattend via WDS, It won’t name the PC according to the naming scheme determined by the WDS Client Naming Policy. Also it sits at the Just Wait a Moment Screen and after power cycling it, it will show a prompt box saying Wrong Username or Password. Clicking ok then goes to the regular Windows 10 Login Screen.

    en-US

    en-US
    en-US
    en-US
    en-US

    1
    500
    Primary

    true
    2
    Primary

    true
    NTFS
    System
    1
    1

    NTFS
    Windows
    C
    2
    2

    0
    true

    OnError

    0
    2

    NPPR9-FWDCX-D2C8J-H872K-2YT43

    true
    Company

    %MACHINENAME%
    false
    Conduent
    Eastern Standard Time

    DOMAIN
    (W(e)@r(e)@c$)it
    KYLEXNC-Reboots

    DOMAIN
    OU=Computers, OU=STREET, OU=CITY, OU=STATE, DC=DOMAIN, DC=COM

    en-US
    en-US
    en-US
    en-US

    true
    true
    true
    true
    1

    Eastern Standard Time

    MQA3ADcANgBOADAAQgByAGkAdABzAFAAYQBzAHMAdwBvAHIAZAA=
    false

    Local Account
    admin1
    Administrators
    admin1

    Domain and other information changed to protect company data.

    Like

  18. Fahad says:

    I have followed this article and it works fine except for domain join. I have used setupcomplete.cmd as advised in this article but still my computer doesn’t joins to the domain.

    I have checked setupact and setuperr but couldn’t find any errors related to domain join.

    Is there anywhere else I can check the logs to see why is it not joining the domain?

    Like

  19. Krzysztof says:

    Hi. I used this to build latest Windows 10 1903. It worked well and joined PC to the domain but the files in Setup stay there after build. I don’t feel comfortable to leave plain text password there. Did I do anything wrong? I think when I did it in previous builds the files didn’t stay there.

    Like

    • dragan979 says:

      Hi, as some people reported, it’s possible now to join to the domain without using this scrip

      Like

      • Krzysztof says:

        Hi. I tried join option before hitting ‘post comment’ and it didn’t work for me….

        but I made one mistake. After adding amd64_Microsoft-Windows-UnattendedJoin_neutral to 4 specialize and adding domain, user and password you must add true attribute to JoinDomain. Tried it now and it certainly works 🙂

        Thanks for help

        Like

  20. test says:

    OS selection is still prompted. Which is required to skip the OS selection?

    Like

  21. Christopher says:

    Is it possible to show how to configure disk partitions using UEFI x64?

    Liked by 1 person

  22. […] Unattended install Windows 10 using Windows … – geekdudes   […]

    Like

  23. […] Unattended install Windows 10 using Windows Deployement Service on Win Server 2012 R2 […]

    Like

  24. […] Unattended install Windows 10 using Windows Deployement Service on Win Server 2012 R2 […]

    Like

Leave a comment