How to Sysprep Windows Server 2008 R2

Right now I am working on a project which aims to deliver a fully dynamic IT infrastructure to one of the leading investment and development companies in the region.

A key part of this Dynamic Infrastructure is the rapid, automated deployment of servers and workstations alike within their chosen virtuaization platform as well as physical server environment. The infrastructure will primarily be based on Windows Server 2008 R2 and therefore one of my tasks has been looking into the unattended installation & sysprep of Windows 2008 R2.

A few things have changed in th way that sysprep now works, these are listed here. Key changes worth noting are;

  • Sysprep now uses an XML file to store settings rather than the traditional Sysprep.inf
  • There is no longer a Config Manager tool to create the XML File
  • There is no longer any real GUI to Sysprep.exe
  • Sysprep is included by default with the Windows Server Installation

So the question is How do we work with Sysprep now?

The Answer:

  1. Download the Windows 7 Automated Installation Kit from the Microsoft Website (approx. 1.7GB)
  2. Install the Automated Installation Kit on the Computer where you wish to prepare the Unattend.xml file (I do not recommend using the server / image you wish to sysprep, use a workstation or another server instead)
  3. Copy the Install.wim and all the .clg files from the Windows 2008 Media on to a folder / directory on your computer
  4. Remove the Read-Only attribute from Install.wim and all the .clg files
  5. In the Start Menu, locate  & open the Windows System Image Manager (WSIM) which is in the Microosft Windows AIK folder
  6. Right-Click the white space beneath Windows Image in WSIM and choose Select Windows Image
  7. Browse to the location of your WIM & CLG files and open the CLG file which corresponds with the version of Windows Server you wish to sysprep.
  8. Right Click the white space beneath Answer File in the center of the WSIM window and select New Answer File
  9. Drag and Drop the various components you wish to customize from the Component Section of the Windows Image on to the respective operation in the Answer File & modify the settings according to your requirements.

Guidence to what actually happens at each of the listed phases can be found here.

Once you are done, you can save the file as Unattend.xml then copy the file to c:\windows\system32\sysprep on the server which you want to sysprep.

To sysprep the server, from command prompt navigate to c:\windows\system32\sysprep then type the following:

sysprep.exe /generalize /oobe /shutdown /unattend:unattend.xml

If possible I would recommend testing your sysprep file in a virtual machine which has been snap-shotted before running it on the actual image which you want to sysprep. I went through a number of re-installs thanks to some issues with my sysprep settings which wasted a good amount of my time.

For those who do not require any extensive customization of the Sysprep Image and just need a working sysprep that includes the corporate product key, some corporate info and the default admin password, below is a sample unattend.xml file which provides just this functionality:

 <?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <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">
            <ProductKey>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</ProductKey>
            <RegisteredOrganization>Organization Name</RegisteredOrganization>
            <RegisteredOwner>Company Owner</RegisteredOwner>
            <TimeZone>(UTC+04:00) Abu Dhabi, Muscat</TimeZone>
            <DisableAutoDaylightTimeSet>true</DisableAutoDaylightTimeSet>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:c:/w8kr2%20sysprep/install.wim#Windows Server 2008 R2 SERVERENTERPRISE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

 

What did you think of this article?




Trackbacks
  • Trackbacks are closed for this post.
Comments
Page: 1 of 1
  • 29 Oct 2009, 8:52 PM Jedediah Wilson wrote:
    does the entry processorArchitecture="amd64"
    mean that the system you are going to run sysprep on is an amd processor 64-bit?
    what selection would you use for an intel processor 64-bit.
    Looks like the options are amd64, wow64, x86
    1. 30 Oct 2009, 10:12 AM Johan Dreyer wrote:

      The processorArchitecture="amd64" refers to any 64bit installation of Windows, regardless of the actual processor manufacturer and is in fact quite widely used as such even in other operating systems and therefore you would use the same selection for both Intel & AMD processors.

      The wow64 option is used within a 64bit Windows architecture to run 32bit applications, e.g. 32bit Internet Explorer, and is actually known as Windows on Windows 64.

      The x86 option then, obiously, applies to 32bit Windows installations regardless of the processor type that they are installed on.

      Additionally, for server based products, there is another architecture option, which is much less common due to its specialized usage scenarios and incompatibility with the standard x86 command and function set, called the IA-64 or Itanium64 Processor architecture.

      Hope this answers your questions.


  • 10 Nov 2009, 5:27 PM web development wrote:
    Humm... interesting,

    Some fairly noticeable differences...

    Thanks for writing, most people don't bother.
  • 23 Feb 2010, 6:32 AM Lee Turchin wrote:
    I have read that the R2 sysprep image must somehow be configured to apply its special disk partitioning scheme during the sysprep phase. Do you happen to know which component of the answer file is configured for those settings. I believe that they are the system, recovery and windows partitions.
    I found an Microsoft script that applies the following using diskpart.txt

    select disk 0
    clean
    create partition primary size=3000 id=27
    format quick fs=ntfs label="Recovery"
    assign letter="R"
    create partition primary size=300
    format quick fs=ntfs label="System"
    assign letter="S"
    active
    create partition primary
    format quick fs=ntfs label="Windows"
    assign letter="W"
    exit

    When I attempt to apply the above commands to the blade, I get a warning that "the partition you specified is not an OEM or ESP partition. Please select an OEM or ESP partition and try again."

    Thank you in advance,
    Lee Turchin
    1. 11 Mar 2010, 9:26 AM Johan Dreyer wrote:

      Hi Lee,

      Unfortunately I have never tried this and don't have the hardware at the moment to check it out. I usually just setup my partitioning after the server is built considering that it is possible in Windows 2008 to dynamically resize disks from the Disk Manager.

      Kind Regards,

      Johan



Page: 1 of 1
Leave a comment

Comments are closed.