Friday, January 3, 2014

Windows 7 Sysprep rearm problem

Every time I build an image for deployment using Windows Deployment Services I sysprep it in order to clean out all user settings and to reset the SID. Usually, I only need to sysprep the master image once but this time around I had forgotten a couple of things and ended up re-running sysprep a few times. I also needed to test the image capture process due to some files duplication issues. When I was ready to sysprep the image for the final time I got an error which read: ‘A fatal error occurred while trying to sysprep the machine’

It turns out that Microsoft, in its wisdom, decided to limit the number of times that a Windows image can be syspreped to just three. The fourth time someone runs sysprep the process fails. This has to do with resetting (re-arming) of the licensing information. There are a few workarounds to this, one involving creating an unattended installation xml file. I’ve found the following to be the quickest and easiest:

Once the master image is ready to be syspreped open command prompt and run slmgr /dlv
You will see the following screen:




If you see that the remaining windows rearm count is at 0 you will need to edit the registry to trick Windows into thinking that it has one more rearm available.
Go to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SoftwareProtectionPlatform\SkipRearm and change the value from 0 to 1

Re-run sysprep and it should complete.

Once you run sysprep, the SkipRearm registry value will change back to 0

In some instances you may also need to change the value of the Generalization State key.

Go into the registry and set HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState to 7.