Sample Unattend Files

Applies To: Windows Server 2008, Windows Server 2008 R2

In This Topic

  • Windows Deployment Services Client Unattend Files

    • Example 1: Standard installation

    • Example 2: Install a language pack

  • Image Unattend Files for Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2

    • Example 1: Unsecure domain join

    • Example 2: Secure domain join

    • Example 3: Using variables

  • Image Unattend Files for Older Operating Systems

    • Example 1: Domain join

    • Example 2: Using variables

    • Example 3: Run a script

  • Combined Image and Client Unattend File

  • Image Capture Wizard Unattend File

Note

To download the Windows Deployment Services documentation (including a getting started guide, deployment guide, and WDSUTIL command-line syntax), see https://go.microsoft.com/fwlink/?LinkId=89381.

Windows Deployment Services Client Unattend Files

Example 1: Standard installation

The following file contains all of the standard attributes that are needed to automate the UI screens. It specifies the language for the installation (<SetupUILanguage>), the credentials for the client to access the Windows Deployment Services server (<Credentials>), and the image for installing on the client computer (<ImageName>). It also configures the disk layout – for example, the image will be installed on the first partition (<PartitionID>) and the first disk (<DiskID>) on the client computer.

<?xml version="1.0" ?> 
<unattend xmlns="urn:schemas-microsoft-com:unattend">
   <settings pass="windowsPE">
      <component name="Microsoft-Windows-Setup" publicKeyToken="31bf3856ad364e35" 
language="neutral" versionScope="nonSxS" processorArchitecture="x86">
         <WindowsDeploymentServices>
            <Login>
               <WillShowUI>OnError</WillShowUI>
               <Credentials>
                     <Username>username</Username>
                     <Domain>Fabrikam.com</Domain>
                     <Password>my_password</Password>
                  </Credentials>
               </Login>
            <ImageSelection>
               <WillShowUI>OnError</WillShowUI>
               <InstallImage>
                  <ImageName>Windows Vista with Office</ImageName>
                  <ImageGroup>ImageGroup1</ImageGroup>
                  <Filename>Install.wim</Filename>
               </InstallImage>
                  <InstallTo>
                  <DiskID>0</DiskID>
                  <PartitionID>1</PartitionID>
               </InstallTo>
            </ImageSelection>
         </WindowsDeploymentServices>
         <DiskConfiguration>
            <WillShowUI>OnError</WillShowUI>
               <Disk>
                  <DiskID>0</DiskID>
                  <WillWipeDisk>false</WillWipeDisk>
                  <ModifyPartitions>
                     <ModifyPartition>
                        <Order>1</Order>
                        <PartitionID>1</PartitionID>
                        <Letter>C</Letter>
                        <Label>TestOS</Label>
                        <Format>NTFS</Format>
                        <Active>true</Active>
                        <Extend>false</Extend>
                     </ModifyPartition>
                  </ModifyPartitions>
            </Disk>
         </DiskConfiguration>
      </component>
      <component name="Microsoft-Windows-International-Core-WinPE" publicKeyToken="31bf3856ad364e35" 
language="neutral" versionScope="nonSxS" processorArchitecture="x86">
         <SetupUILanguage>
            <WillShowUI>OnError</WillShowUI>
            <UILanguage>en-US</UILanguage>
         </SetupUILanguage>
         <UILanguage>en-US</UILanguage>
      </component>
   </settings>
</unattend> 

Example 2: Install a language pack

You can use the following example file to install a language pack. If the <UILanguage> is the same as the language on the image, then Windows Deployment Services will not install a language pack. However, if you use the following example with an English image, then (because of <UILanguage>de-de</UILanguage>) Windows Deployment Services will look for a German language pack on the server at C:\RemoteInstall\Images\<imagefilename>\Langpacks\de-de.

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86">
            <WindowsDeploymentServices>
                <Login>
                    <WillShowUI>OnError</WillShowUI>
                    <Credentials>
                        <Username>Administrator</Username>
                        <Domain>Fabrikam.com</Domain>
                        <Password>Password1</Password>
                    </Credentials>
                </Login>
                <ImageSelection>
                    <WillShowUI>OnError</WillShowUI>
                    <InstallImage>
                        <ImageName>Windows Vista Ultimate</ImageName>
                        <ImageGroup>ImageGroup1</ImageGroup>
                    </InstallImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>1</PartitionID>
                    </InstallTo>
                </ImageSelection>
            </WindowsDeploymentServices>
            <DiskConfiguration>
                <WillShowUI>OnError</WillShowUI>
                <Disk>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>false</WillWipeDisk>
                    <ModifyPartitions>
                        <ModifyPartition>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                            <Letter>C</Letter>
                            <Label>Vista</Label>
                            <Format>NTFS</Format>
                            <Active>true</Active>
                            <Extend>false</Extend>
                        </ModifyPartition>
                    </ModifyPartitions>
                </Disk>
            </DiskConfiguration>
        </component>
        <component name="Microsoft-Windows-International-Core-WinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86">
            <SetupUILanguage>
                <WillShowUI>OnError</WillShowUI>
                <UILanguage>en-US</UILanguage>
            </SetupUILanguage>
            <UILanguage>de-de</UILanguage>
            <SystemLocale>de-de</SystemLocale>
            <UserLocale>de-de</UserLocale>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

Image Unattend Files for Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2

Example 1: Unsecure domain join

This file sets the password for the computer to a dynamically generated and shared password, and joins the computer to a domain without credentials. The password will be inserted into this unattend file as the <MachinePassword> value in the <Identification> section. The attributes that define this domain join method are <UnsecureJoin>true</UnsecureJoin> and the Microsoft-Windows-Shell-Setup component. For more information about this method, see the “Ensuring Security” section of Automating the Domain Join.

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="specialize">
        <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" 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-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" 
language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" 

xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance">
            <ProductKey>XXXX-XXXX-XXXX-XXXX-XXXX</ProductKey>
        </component>
    </settings>
</unattend>

Example 2: Secure domain join

This example uses the credentials specified in this file (user name, domain, and password) to perform the domain join. The attributes that define this domain join method are <UnsecureJoin>false</UnsecureJoin>, <Credentials>, and the Microsoft-Windows-Shell-Setup component. During installation, Windows Deployment Services will retrieve the name of the prestaged account from Active Directory Domain Services (AD DS) and replace the %MACHINENAME% string with the actual computer name. For more information about this method, see the “Ensuring Security” section of Automating the Domain Join.

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="specialize">
        <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" 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>false</UnsecureJoin>
                <Credentials>
                    <Domain>Fabrikam.com</Domain>
                    <Password>Password1</Password>
                    <Username>MyUserName</Username>
                </Credentials>
            </Identification>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" 
language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance">
            <ComputerName>%MACHINENAME%</ComputerName>
        </component>
    </settings>
</unattend>

Example 3: Using variables

In the following example, Windows Deployment Services will automatically replace the %USERDOMAIN%, %USERPASSWORD%, %USERNAME%, and %MACHINEDOMAIN% variables using the proper values. For more information, see "Using Variables to Obtain Information From the Client" in Advanced Unattended Installation Scenarios.

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="specialize">
        <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" 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>
                <Credentials>
                    <Domain>%USERDOMAIN%</Domain>
                    <Password>%USERPASSWORD%</Password>
                    <Username>%USERNAME%</Username>
                </Credentials>
                <JoinDomain>%MACHINEDOMAIN%</JoinDomain>
            </Identification>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" 
language="neutral" versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" 
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance">
            <ComputerName>%MACHINENAME%</ComputerName>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" 
versionScope="nonSxS" xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance">
            <UserAccounts>
                <DomainAccounts>
                    <DomainAccountList wcm:action="add">
                        <Domain>%USERDOMAIN%</Domain>
                        <DomainAccount wcm:action="add">
                            <Group>Administrators</Group>
                            <Name>%USERNAME%</Name>
                        </DomainAccount>
                    </DomainAccountList>
                </DomainAccounts>
            </UserAccounts>
            <RegisteredOrganization>%ORGNAME%</RegisteredOrganization>
        </component>
    </settings>
</unattend>

Image Unattend Files for Older Operating Systems

Example 1: Domain join

The following is an example Sysprep.inf file that sets the password of the computer account to the computer name, and joins the computer to a domain without credentials.

[Identification]
DoOldStyleDomainJoin=Yes

[Networking]

[UserData]

Example 2: Using variables

In the following Sysprep.inf example, Windows Deployment Services will automatically replace the %ORGNAME%, %MACHINENAME%, %TIMEZONE%, and %MACHINEDOMAIN% variables using the proper values. For more information, see "Using Variables to Obtain Information From the Client" in Advanced Unattended Installation Scenarios.

[UserData]
OrgName = "%ORGNAME%"
ComputerName = %MACHINENAME%
ProductKey= "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"

[GuiUnattended]
TimeZone = %TIMEZONE%

[Networking]

[Identification]
JoinDomain = %MACHINEDOMAIN%
DoOldStyleDomainJoin = Yes

Example 3: Run a script

The following is an example Sysprep.inf file that runs a script on first logon (Command0), sets the administrator password (AdminPassword), and bypasses the Welcome screen (AutoLogon).

[GuiRunOnce]
Command0 = "set path=c:\scripts;%PATH%"

[GuiUnattended]
AutoLogon = Yes
AdminPassword = Password1!
OEMSkipRegional = 1
OemSkipWelcome = 1
TimeZone = %TIMEZONE%


[Identification]
JoinDomain = %MACHINEDOMAIN%
DoOldStyleDomainJoin = Yes


Combined Image and Client Unattend File

The following is a single .xml unattend file that automates the entire installation process (the Windows Deployment Services client UI screens and the remaining phases of Setup). To use this file, update the file with information for your environment and then configure the command-line unattend precedence appropriately (for precedence information, see Advanced Unattended Installation Scenarios). Then pass this file to Setup.exe with the /unattend:<unattend file> option.

<unattend xmlns="urn:schemas-microsoft-com:unattend"> 
<settings pass="windowsPE"> 
      <component name="Microsoft-Windows-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86"> 
            <WindowsDeploymentServices>
                      <Login>
                          <WillShowUI>OnError</WillShowUI>
                      <Credentials>
                              <Username>Administrator</Username>
                             <Domain>Fabrikam.com</Domain>
                           <Password>Password1</Password>
                          </Credentials>
                      </Login>
                  <ImageSelection>
                          <InstallImage>
                             <ImageName>Install Image</ImageName>
                           <ImageGroup>defaultx86</ImageGroup>
                              <Filename>install.wim</Filename>
                          </InstallImage>
                        <WillShowUI>OnError</WillShowUI>
                        <InstallTo>
                              <DiskID>0</DiskID>
                              <PartitionID>1</PartitionID>
                        </InstallTo>
                  </ImageSelection>
            </WindowsDeploymentServices>
            <DiskConfiguration> 
                  <WillShowUI>OnError</WillShowUI> 
                  <Disk> 
                        <DiskID>0</DiskID> 
                        <WillWipeDisk>false</WillWipeDisk> 
                        <ModifyPartitions> 
                              <ModifyPartition> 
                                    <Order>1</Order>  
                                    <PartitionID>1</PartitionID> 
                                    <Letter>C</Letter> 
                                    <Label>Vista</Label> 
                                    <Format>NTFS</Format> 
                                    <Active>true</Active> 
                                    <Extend>false</Extend> 
                              </ModifyPartition> 
                        </ModifyPartitions> 
                  </Disk> 
            </DiskConfiguration> 
      </component> 
      <component name="Microsoft-Windows-International-Core-WinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86">
            <SetupUILanguage>
                  <WillShowUI>OnError</WillShowUI>
                  <UILanguage>en-US</UILanguage>
            </SetupUILanguage>
            <UILanguage>en-US</UILanguage>
      </component>
</settings>
<settings pass="specialize">
      <component name="Microsoft-Windows-UnattendedJoin" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86">
            <Identification>
                  <UnsecureJoin>true</UnsecureJoin>  
            </Identification>
      </component>
      <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86">
            <ComputerName>computer1</ComputerName>
      </component>
      <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86">
            <SecurityLayer>2</SecurityLayer>
            <UserAuthentication>2</UserAuthentication>
      </component>
      <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86">
            <fDenyTSConnections>false</fDenyTSConnections>
      </component>
</settings>
<settings pass="oobeSystem">
      <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86">
            <OOBE> 
                  <HideEULAPage>true</HideEULAPage> 
                  <NetworkLocation>Work</NetworkLocation> 
                  <ProtectYourPC>1</ProtectYourPC>
                  <SkipMachineOOBE>true</SkipMachineOOBE> 
                  <SkipUserOOBE>true</SkipUserOOBE> 
            </OOBE> 
            <Display>
                  <ColorDepth>32</ColorDepth>
                  <DPI>96</DPI>
                  <HorizontalResolution>1024</HorizontalResolution>
                  <RefreshRate>60</RefreshRate>
                  <VerticalResolution>768</VerticalResolution>
            </Display>
            <UserAccounts>
                  <LocalAccounts>
                        <LocalAccount>
                              <Password>
                                    <Value>Password1</Value>
                                    <PlainText>true</PlainText>
                              </Password>
                              <Description>My Local Account</Description>
                              <DisplayName>John Smith</DisplayName>
                              <Group>Administrators;Power Users</Group>
                              <Name>John</Name>
                        </LocalAccount>
                  </LocalAccounts>
                  <DomainAccounts>
                              <DomainAccountList>
                              <DomainAccount>
                                    <Name>Administrator</Name>
                                    <Group>Administrators;Power Users</Group>
                              </DomainAccount>
                              <Domain>Fabrikam.com</Domain>
                        </DomainAccountList>
                  </DomainAccounts>
            </UserAccounts>
      </component>
</settings>
</unattend> 

Image Capture Wizard Unattend File

The following is an example file that automates the UI screens of the Image Capture Wizard. To use this file, first update each section with the information for your environment. For example, the [ExclusionList] specifies the files that the capture process will exclude from capturing. Then create a capture image and save this file within the image. To do this, mount the image using ImageX, save this file as Windows\system32\Wdscapture.inf (overwrite the existing Wdscapture.inf), and then unmount the image. Lastly, add the capture image to the Windows Deployment Services server. When you boot a computer into this image, the UI screens will be automated and the image will be uploaded to the server with the settings you have specified.


[Capture] 
Unattended=Yes 
VolumeToCapture=C: 
SystemRoot=windows 
ImageName="WindowsVista" 
ImageDescription="Windows Vista ULTIMATE with Office"
DestinationFile=C:\Capture.wim
Overwrite=Yes 
[ExclusionList] 
$ntfs.log 
hiberfil.sys 
pagefile.sys 
"System Volume Information" 
RECYCLER 
winpepge.sys 
%SYSTEMROOT%\CSC 
[WDS] 
UploadToWDSServer=Yes 
WDSServerName=WDSServer 
WDSImageGroup="ImageGroup1" 
Username=Username 
Domain=Domain 
Password=Password1
DeleteLocalWimOnSuccess=No