Deploy Windows 7 with WDS

By Rory Monaghan

SHARE

I decided to put this together because when I was trying to work with WDS (Windows Deployment Services) with my buddy Louie Meraz we found the information online to be somewhat incomplete. It would get us past one issue and on to another one. Some people seemed to do it one way and others did it a different way. We learned that there’s only a few steps you have to do and once you’ve got it down, it is really easy. WDS is a built in role in Server 2008 R2 so if you’ve got a server you should be able to use it for your image deployment. What you will need to get it working for Windows 7 is as follows.

 

 

 

 

 

 

  • Create your Image
  • Pre-Stage the machine in Active Directory
  • ImageUnattend.xml
  • HostName.xml (oobeUnattend)
  • Inject the drivers

Create your Image

If you are familiar with any other OS deployment mechanisms you have probably used sysprep before. To create your image you need to use a clean Windows 7 machine, add the software you would like. Ensure you clean up all the profiles you don’t want the users to get or any other undesirable “noise”. Ensure your machine is off the domain and run sysprep by running via the command line:

sysprep /oobe /generalize /reboot

Pre-Stage the machine in Active Directory

The first step of the process is to pre-stage the machine you wish to push your Windows 7 image to in Active Directory. By doing this you ensure when going through the PXE boot, WDS will use the OobeUnattend.xml file associated to your machine and it also ensures the correct machine name is given to your machine when the Operating System has been put down. You can do this simply with a command run on your server as follows:

C:\Windows\System32\WDSUTIL /Add-Device /Device: <HostName> /ID: <MacAddress>   /WDSClientUnattend:HostName.xml /BootProgram:boot\x64\PXEboot.

n12 /BootImagePath:boot\x64\images\boot.wim /OU:””OU=Desktops,OU=Computer Accounts,DC=CompDC,DC=net,DC=Company,DC=com”””
The above command is running the WDSUtil to Add a device, you must provide the machine Hostname and MAC address. You also associate an XML file, it’s a good idea to give it a unique name such as the machine hostname again. You will use the PXEboot and a boot.wim, you can use the out of the box provided by Microsoft as part of Windows 7 for this. Just browse the DVD of Windows 7 and grab the boot.wim. Use the Boot Program that applies to the  You also need to pass the Active Directory LDAP directory in which you want the computer to reside. After you run the command you should be able to find the machine created in AD, you should be able to find a Remote Install tab which will show you a GUID that contains the MAC address you entered as well as the Boot Program selected. You should also see a file Hostname.xml created under the WDSClientUnattend folder which is under the RemoteInstall folder.
 ImageUnattend.xml
For Windows 7 deployment in WDS the XML files are what’s used to make the deployment zero touch or silent. The ImageUnattend.xml file takes care of some of the initial OS settings. When you setup Windows 7 manually you get prompted at a few steps during the setup e.g. What drive or partition to install on. The contents of the file should look like this:
<?xml version=”1.0″ encoding=”utf-8″?>
<unattend xmlns=”urn:schemas-microsoft-com:unattend”>
    <settings pass=”windowsPE”>
        <component name=”Microsoft-Windows-Setup” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
            <DiskConfiguration>
                <WillShowUI>OnError</WillShowUI>
                <Disk>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                    <CreatePartitions>
                         <CreatePartition>
                            <Order>1</Order>
                            <Type>Primary</Type>
                            <Extend>true</Extend>
                         </CreatePartition>
                    </CreatePartitions>
                </Disk>
            </DiskConfiguration>
            <WindowsDeploymentServices>
                <ImageSelection>
                    <InstallImage>
                        <ImageGroup>Win7Desktop</ImageGroup>
                        <ImageName>Windows7</ImageName>
                    </InstallImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>1</PartitionID>
                    </InstallTo>
                    <WillShowUI>Never</WillShowUI>
                </ImageSelection>
            </WindowsDeploymentServices>
            <EnableFirewall>false</EnableFirewall>
            <EnableNetwork>true</EnableNetwork>
            <Restart>Restart</Restart>
        </component>
        <component name=”Microsoft-Windows-International-Core-WinPE” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
            <SetupUILanguage>
            <UILanguage>en-US</UILanguage>
            <WillShowUI>Never</WillShowUI>
            </SetupUILanguage>
            <UILanguage>en-US</UILanguage>
            <UILanguageFallback>en-US</UILanguageFallback>
            <UserLocale>en-US</UserLocale>
            <InputLocale>en-US</InputLocale>
            <SystemLocale>en-US</SystemLocale>
        </component>
    </settings>
    <settings pass=”auditSystem”>
        <component name=”Microsoft-Windows-Deployment” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
            <AuditComputerName>
                <Name></Name>
                <MustReboot>true</MustReboot>
            </AuditComputerName>
        </component>
        <component name=”Microsoft-Windows-Shell-Setup” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
            <TimeZone>US Mountain Standard Time</TimeZone>
            <DisableAutoDaylightTimeSet>true</DisableAutoDaylightTimeSet>
        </component>
    </settings>
    <settings pass=”specialize”>
        <component name=”Microsoft-Windows-Shell-Setup” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
            <DisableAutoDaylightTimeSet>true</DisableAutoDaylightTimeSet>
            <TimeZone>Mountain Standard Time</TimeZone>
            <ComputerName></ComputerName>
        </component>
        <component name=”Microsoft-Windows-UnattendedJoin” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
            <Identification>
                <UnsecureJoin>true</UnsecureJoin>
            </Identification>
        </component>
        <component name=”Microsoft-Windows-International-Core” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://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>
    </settings>
    <settings pass=”oobeSystem”>
        <component name=”Microsoft-Windows-International-Core” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://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>
    </settings>
    <cpi:offlineImage cpi:source=”catalog://Server/wdsvol/operating systems/windows 7/windows 7 w_sp1/windows 7 w_sp1_x64/sw_dvd5_win_pro_7w_sp1_64bit_english_mlf_x17-28603/sources/install_windows 7 professional.clg” xmlns:cpi=”urn:schemas-microsoft-com:cpi” />
</unattend>
Important
<ImageGroup>ProdDesktop</ImageGroup>
<ImageName>W7June2012</ImageName>
The above need to relate to where you have stored your image in WDS. For my example I have put mine in ProdDesktop. The name of my image is W7June2012.wim.
<ComputerName></ComputerName>
This is left blank to ensure WDS grabs the machine name from Active Directory.
<UnsecureJoin>true</UnsecureJoin>
UnsecureJoin ensures the machine is joined to your domain.
Once you have created your ImageUnattend.xml file you should associate this with the correct machine type in WDS. You can do this by going to the Image Properties menu.
Hostname.xml
Hostname.xml will take care of automating the steps post sysprep. So the initial XML file is used to provide Windows 7 with what it needs to start the build e.g. partition to install on, input language etc. This hostname file will give what’s needed once the machine reboots and the sysprep has been run presenting with dialogs to enter that are unique for each machine e.g. Join the domain, Computer Name, Time Zone. There’s a bit of duplication in the files but this does work.
<?xml version=”1.0″ encoding=”utf-8″?>
<unattend xmlns=”urn:schemas-microsoft-com:unattend”>
<settings pass=”windowsPE”>
<component name=”Microsoft-Windows-Setup” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
<DiskConfiguration>
<WillShowUI>OnError</WillShowUI>
<Disk>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<CreatePartitions>
<CreatePartition>
<Order>1</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
</Disk>
</DiskConfiguration>
<WindowsDeploymentServices>
<ImageSelection>
<InstallImage>
<ImageGroup>ProdDesktop</ImageGroup>
<ImageName>W7June2012</ImageName>
</InstallImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
<WillShowUI>Never</WillShowUI>
</ImageSelection>
</WindowsDeploymentServices>
<EnableFirewall>false</EnableFirewall>
<EnableNetwork>true</EnableNetwork>
<Restart>Restart</Restart>
</component>
<component name=”Microsoft-Windows-International-Core-WinPE” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
<WillShowUI>Never</WillShowUI>
</SetupUILanguage>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>en-US</UserLocale>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
</component>
</settings>
<settings pass=”auditSystem”>
<component name=”Microsoft-Windows-Deployment” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
<AuditComputerName>
<Name></Name>
<MustReboot>true</MustReboot>
</AuditComputerName>
</component>
<component name=”Microsoft-Windows-Shell-Setup” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
<TimeZone>US Mountain Standard Time</TimeZone>
<DisableAutoDaylightTimeSet>true</DisableAutoDaylightTimeSet>
</component>
</settings>
<settings pass=”specialize”>
<component name=”Microsoft-Windows-Shell-Setup” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
<DisableAutoDaylightTimeSet>true</DisableAutoDaylightTimeSet>
<TimeZone>Mountain Standard Time</TimeZone>
<ComputerName></ComputerName>
</component>
<component name=”Microsoft-Windows-UnattendedJoin” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://www.w3.org/2001/XMLSchema-instance”>
<Identification>
<UnsecureJoin>true</UnsecureJoin>
</Identification>
</component>
<component name=”Microsoft-Windows-International-Core” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://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>
</settings>
<settings pass=”oobeSystem”>
<component name=”Microsoft-Windows-International-Core” processorArchitecture=”amd64″ publicKeyToken=”31bf3856ad364e35″ language=”neutral” versionScope=”nonSxS” xmlns:wcm=”https://schemas.microsoft.com/WMIConfig/2002/State” xmlns:xsi=”https://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>
</settings>
<cpi:offlineImage cpi:source=”catalog://Server/wdsvol/operating systems/windows 7/windows 7 w_sp1/windows 7 w_sp1_x64/sw_dvd5_win_pro_7w_sp1_64bit_english_mlf_x17-28603/sources/install_windows 7 professional.clg” xmlns:cpi=”urn:schemas-microsoft-com:cpi” />
</unattend>
Inject the drivers
Every hardware manufacturer and machine comes with it’s own set of drivers. If you install Windows 7 on your machine and notice any drivers missing you should go to the manufacturers website and download whatever drivers are missing and then browse to Drivers in WDS and inject them in for your model. You should first create a group with your laptop or desktop name and then add driver packages by browsing to a folder that contains all of the missing drivers you downloaded.
From here you should set to pre-stage any further machines you would like to image with WDS, you should do a network boot and simply run through the Windows Setup x86 or x64 option depending on the machine type you setup for (Your ImageUnattend.xml is setup for) . You will be prompted for login credentials which must have access to WDS. This completes the steps.

Let's make virtualization easier!

Be amongst the first to know when I publish new reviews, guides and tools to simplify your projects.

By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.

We'll virtualise your 5 most complex apps for FREE