Well, howto sysprep 2003 and XP installations is a walk in the park, everyone knows that… but sysprepping a Windows 2008,Vista or 7/2008R2 installation is a bit more difficult.

Here’s what you do:
Use this sample sysprep.xml file, modify the values to your needs, add some stuff, remove some stuff. I’ll explain in brief what the sysprep.xml does ;)

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <ComputerName>*</ComputerName>
      <RegisteredOrganization>Henk</RegisteredOrganization>
      <RegisteredOwner>Henk</RegisteredOwner>
      <ShowWindowsLive>false</ShowWindowsLive>
      <ProductKey>AAAAA-BBBBB-CCCCC-DDDDD-EEEEE</ProductKey>
    </component>
    <component name="Microsoft-Windows-Security-Licensing-SLC-UX" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <SkipAutoActivation>true</SkipAutoActivation>
    </component>
    <component name="Microsoft-Windows-IE-ESC" 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">
      <IEHardenAdmin>false</IEHardenAdmin>
      <IEHardenUser>false</IEHardenUser>
    </component>
  </settings>
  <settings pass="oobeSystem">
    <component name="Microsoft-Windows-International-Core" processorArchitecture="x86" 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>0409:00000409</InputLocale>
      <SystemLocale>en-us</SystemLocale>
      <UILanguage>en-us</UILanguage>
      <UserLocale>en-us</UserLocale>
    </component>
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <RegisteredOrganization>Henk</RegisteredOrganization>
      <RegisteredOwner>Henk</RegisteredOwner>
      <UserAccounts>
        <AdministratorPassword>
          <Value>p@ssw0rd</Value>
          <PlainText>true</PlainText>
        </AdministratorPassword>
      </UserAccounts>
      <OOBE>
        <HideEULAPage>true</HideEULAPage>
        <NetworkLocation>Work</NetworkLocation>
        <ProtectYourPC>3</ProtectYourPC>
      </OOBE>
      <Display>
        <ColorDepth>32</ColorDepth>
        <HorizontalResolution>1024</HorizontalResolution>
        <VerticalResolution>768</VerticalResolution>
      </Display>
      <TimeZone>W. Europe Standard Time</TimeZone>
    </component>
  </settings>
  <settings pass="generalize">
    <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
    </component>
    <component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
    </component>
  </settings>
</unattend>

In short what this sysprep.xml does (from bottom to top):

  • Disables the Initial Configuration Tasks screen at logon
  • Disables the Server Manager screen at logon
  • Sets timezone to W. Europe Standard Time
  • Sets resolution to 1024x768x32
  • Sets Automatic Updates to not configured
  • Sets the Network connection to Work
  • Hides the EULA prompt
  • Sets the administrator password to: p@ssw0rd
  • Sets the Organization and Registered user to Henk
  • Sets User, UI, System and InputLocale to en-US
  • Disables the IE Enhanced Security Configuration
  • Skips auto-activation of Windows
  • Sets the product key to AAAAA-BBBBB-CCCCC-DDDDD-EEEEE
  • Disables Windows Live features
  • Generates a Random hostname

Ok, so now you have a sysprep.xml… what do you do with it?
In your Server 2008 (in this example) copy the sysprep.xml to c:\windows\system32\sysprep\sysprep.xml

Now execute: sysprep /generalize /oobe /shutdown /unattend:sysprep.xml
After this your system shuts down, and you can either image it, but in most cases it’s probably a VHD or VMDK file and you just copy it ;) . When you messed up your sysprep.xml and allready ran the sysprep command on your system you will have in most cases no choice but to reinstall the system, and resysprep it. For VHD scenario’s there a little trick, however :) . Read my previous blogpost about editing the unattend.xml file directly inside of the VHD.