Home Tips & Resources Sysprep Windows 7
 
Sysprep Windows 7 PDF Print E-mail
Written by Travis Nuske   
If you feel this tip has saved you time or effort, please consider buying us a cuppa coffee to keep things going!

Guide for preparing Windows 7 using sysprep

Windows 7 uses basically the same sysprep method as XP, in that you setup your master image, create an answer file for sysprep, sysrep the machine and then capture the sysprep'd image with your imaging software of choice (Ghost, Windows Deployment Services etc)

Prepare Windows 7 Master

Note: I strongly suggest building your master windows 7 image in a virtual machine - see the Gotcha's section below:

Build your windows 7 machine and customise as you wish - I like to:

  • Disable System Restore.
  • Run windows update a few times - to take some load off my WSUS server.
  • Move some of the shortcuts from the All users menu that I do not want my end-users access to - the Maintenance, Games and System Tools program groups. - The All users shortcuts are in C:\ProgramData\Microsoft\Windows\Start Menu\
  • I do not install applications at this point, I use Group Policy application management; but you can install and pre-configure applications at this point.
  • If you have installed windows live essentials into your master, install the hotfix at http://support.microsoft.com/kb/981542/ - there have been reports of Windows Live Essentials 2011 breaking sysprep. Installing this hotfix before syspreping should prevent issues.
  • Enable Verbose startup & shutdown messages so I can better see what is going on during login etc:

Open regedit and go to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ Policies\System
In right-side pane create/modify DWORD value VerboseStatus and set its value to: 1

Download the Windows Automated Installation Kit (WAIK) for Windows Server 2008R2 and Windows 7 from Microsoft - Windows Automated Installation Kit (AIK) for Windows 7

Don't do what I did and try to use the WAIK for windows server 2008 and Windows Vista - it will crash trying to open the windows 7 images.

Install the WAIK on a Server - preferably the Windows server running Windows Deployment services (but does not have to be)

Sysprep Unattend.xml file

Creating the unattend.xml file for windows 7 sysprep is a little more involved that the old sysprep.inf for XP.

Once you have installed the WAIK, you will find the Microsoft Windows AIK program group in the start menu - Run the Windows System Image Manager.

Pop your Windows 7 Enterprise disc in the drive, Right click Select a Windows image or catalog file and Choose Select Windows Image from the popup menu. Choose the install.wim file from the sources folder on the DVD

Right click the Create or open an answer file from the Answer file pane and choose New Answer File

Basically from here you drag components from the Windows Image pane into the Answer File pane and then set the option for that component as appropriate. Every deployment requries different components and settings - I'll run through the components that I set below:

Note: you can right click on each component and choose help to display a detailed description of the component.

  1. Drag the x86_Mircosoft-Windows-Deployment<Windows7 Build no.>_neutral component  into the 4 specialize section. Right click the RunSynchronous section and choose Insert New RunSynchronousCommand. Set the Order to 1. Set the Path to net user administrator /activate:yes. This will enable the administrator account (that is usually disabled on Windows 7 machines).
  2. Drag the x86_Microsoft-Windows-Shell-Setup_neutral component into the 4 specialize section. Click on the component and change the CopyProfile property to true. Change the ShowWindowsLive property to false. Change the TimeZone property to your timezone. This must be the display name of the timezone. You can find all the displaynames of the timezones by running this command at the command prompt: tzutil /l you will set a list of the zones, use the name that appears under the timezone. E.g. Cen. Australia Standard Time.
  3. Drag the x86_Microsoft-Windows-International-Core_neutral component into the 7 oobe section. Set the locale settings to your appropriate locales. E.g I set InputLocale to en-us, systemLocale to en-au, UILanguage to en-au, UILanguageFallback to en-us, UserLocale to en-au
  4. Drag the x86_Microsoft-Windows-Shell-Setup_neutral component into the 7 oobe section. Set the RegisteredOrganization to your organisation, and set the RegisteredOwner to the owner or business name. In the Autologon properties set Enabled to true, set LogonCount to 5 and set the Username to adminstrator. Click the password properties and type the administrator password Note: this password will be encrypted in the answer file (not like the old plain text answer file used with XP). Click the OOBE properties and set HideEULAPage to true, set NetworkLocation to Work (or home/public depending on what you need) and set ProtectYourPC to 1 (this sets the windows updates to the recommended level). Click the UserAccounts Properties-> AdministratorPassword setting and type the administrator password (again, this will be encrypted). Right click the LocalAccount property and choose Insert New LocalAccount. Set the Description to Administrator,  set the DisplayName to Administrator, set the Group to Administrators and set the Name to Administrator. Click on thePassword property and set the Value to the administrator password (again, it will be encrytped).

Click File -> Save answer file, Save it as unattend.xml and put it somewhere you will be able to get it when on your master imaged machine.

On your master Windows 7 machine, copy the unattend.xml file into the %systemroot%\System32\sysprep folder.

If you have built your master image inside a virtual machine, take a snapshot.

Once the snapshot is complete, you can go ahead and run the sysprep program.

From an elevated priviledges command prompt run:

%systemroot%\system32\sysprep\sysprep /generalize /shutdown /oobe /unattend:%systemroot%\system32\sysprep\unattend.xml

The system will run sysprep applying your customisations from the unattend.xml file and shutdown.

Once the system shutdown, prepare to image the machine, I like to use Windows Deployment Services to image machines, but you can use Ghost etc.

Gotcha's and Things to Note

A fatal error occurred while trying to Sysprep the machine

When you get this error, check the Setuperr.log file, located in the \Windows\System32\Sysprep\Panther folder.

Error [0x0f0082] SYSPRP LaunchDll: Failure occurred while executing 'C:\Windows\System32\slc.dll, SLReArmWindows', returned error code -1073425657

Any of these three erros listed above are casued by exceeding the number of allowed re-arms. See Windows 7 Rearm Limit below for more info.

Error [0x0f0082] SYSPRP LaunchDll:Failure occurred while executing 'drmv2clt.dll,Sysprep', returned error code -2147024864[gle=0x00000020]

This error is caused by the Windows Media Player Network Sharing Service. There is a bug in Sysprep that will prevent it from running to completion if the Windows Media PLayer Network Sharing Service is running. To disable this service:

  1. Click Start, type services.msc in the search box and press enter.
  2. Scroll down to the Windows Media PLayer Network Sharing Service and set it to disabled.
  3. Reboot the machine at try to run sysprep again.

Windows 7 Rearm Limit

Windows 7 has a "re-arm 3 times" limit in that you can only run sysprep with the /generalize switch 3 times. What I suggest you do is build your Windows 7 master in a virtual environment (something like VMWare or virtualbox) and create a snapshot before you run sysprep. There are lots of references to this on the internet, e.g. http://social.technet.microsoft.com/Forums/en/w7itproinstall/thread/f2805904-9a18-405a-ba97-10773bbe5ea5

You can check the number of re-arms available by running this command:

slmgr.vbs -dlv

Run Sysprep from an elevated command prompt

Make sure that you run sysprep from an elevated priviledges command prompt (right click the command prompt shortcut and choose "run as adminisrator" - If you don't, sysprep will run, but will not load the unattend.xml file so none of your customisations will be applied.

Rearm Office 2010 Installation

If, during your imaging buildng process, you ran any Office 2010 program - such as Word -  You will have created an installation ID for that Office install. I found that when you sysrep the image, and in particualr when you use the /generalize switch, it does not remove the Office installation ID.

If you have run an Office product, you can rearm the installation by running the following program (from an elevated prompt):

c:\Program Files (x86)\Common Files\Microsoft Shared\OfficeSoftwareProtectionPlatform\ospprearm.exe

Last Updated on Thursday, 03 May 2012 12:01
 

Comments  

 
# Guest 2011-03-31 18:46
I was searching the web for a decent how-to for sysprepping windows 7 and i think yours is the most correct one. One typo in yoru text though "only run sysperp" :). I wil let you know if this how-to worked for me.
Reply | Reply with quote | Quote
 
 
# Guest 2011-06-08 12:51
I have a couple of questions:

1) Does the Windows SIM app go through a series of screens similar to setupmgr.exe in Windows XP?

2) Do I have to run the sysprep commands from the command line or can I use a sysprep app in Windows 7?

Obviously I am not very familiar with Windows mass deployments. I am more familiar with Mac deployments. I have deployed Macs with Boot Camp and Windows XP successfully, but Windows 7 seems like another beast altogether.

Thank you for your help in advance! :)
Reply | Reply with quote | Quote
 
 
# Guest 2011-06-08 13:07
Hi Sean,

The Windows System Image manager presents the options in a large tree list, where you pick the options you need to set - it doesn't run through a wizard-like setup program.

I run the sysprep command from the command line - This is because you have to specify the unattend.xml file in addition to the other switches (I find it quicker to copy-n-paste the command from this site than trying to type it, or to replicate it's action using the GUI).

I am part-way through some notes on deploying dual-booting 10.6/Windows 7 Macs at the moment - I just need to tidy up the notes I have made along the way.
Reply | Reply with quote | Quote
 

Add comment


Security code
Refresh