6 Replies Latest reply: May 4, 2012 3:23 AM by Frank Wils RSS

    Sysprep Windows 7 Activation Question


      Hello everyone


      I'm new to Sysprep and have been reading everything I can to get up to speed for Win7 image deployment using LDMS9 SP3 in a corporate environment.  So far, following the articles here, I've been able to capture and deploy a windows 7 image (but am working out some kinks).


      One question that has come up involves Windows 7 Activation.  We use enterprise MAK licenses (not KMS or OEM licenses), so we have a total of 3 resets for Windows Activation.


      For Windows XP, our process for updating our images has been to retain the hard drive we captured the image from so we can update it and recapture the image later (we use NewSID after deployment rather than Sysprep, which is why Sysprep is new to me).


      However, it appears this process may not work for Windows 7 due to the reset limitation for Windows Activation.


      What I have done as a test for Windows 7 is load the OS on a machine and install our additional required corporate software.  Then I ran Sysprep using OOBE and generalize.  Finally I captured the image, then deployed the image to another machine.


      How do I update this image later without running out of activation resets?  Do I need to deploy the image to a machine, update it, then OOBE/generalize it and recapture it?  Will that work?  Is there a way to use the original image I captured (if I retain the hard drive)?


      Thank you for all your help! 

        • 1. Re: Sysprep Windows 7 Activation Question
          Frank Wils SSMMVPGroup



          Easiest way probably is to use a Virtual Machine and snapshot it right before sysprep. That way you can restore to right before the re-arm and build on that.


          Otherwise you can use run sysprep referencing an unattend.xml file with an entry telling sysprep to skip the re-arm,


          for example: sysprep.exe /oobe /generalize /unattend:"c:\unattend.xml" /quit


          This unattend.xml file should contain at least the following:


          <settings pass="generalize">

          <component name="Microsoft-Windows-Security-SPP" 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">





          Make sure to delete this xml before the unattended setup runs because it might interfere with the settings you inject during OSD.


          Windows will skip the re-arm, but during the OSD process you can run the re-activation which will make the MAK or KMS key still unique to that device.


          As you say, Windows out-of-the-box can re-arm only 3 times, but if accidentally that happens to you, you can still recover the image and run the sysprep again by doing the following.


          Generally, you will receive errors in the setupact.log and setuperr.log files like these:

          Error [0x0f0073] SYSPRP RunExternalDlls:Not running DLLs; either the machine is in an invalid state or we couldn’t update the recorded state, dwRet = 31

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

          Error [0x0f0070] SYSPRP RunExternalDlls: An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = -1073425657

          Error [0x0f00a8] SYSPRP WinMain: Hit failure while processing sysprep generalize providers; hr = 0xc004d307


          To remedy this, do the following


          Open regedit and look for:


          Set to value: 2


          Set to value: 7



          msdtc -uninstall (wait a few seconds)

          msdtc -install (wait a few seconds)

          Reboot the system.

          Now you can run sysprep again.




          • 2. Re: Sysprep Windows 7 Activation Question

            Frank - thank you so much for your thorough and helpful response! 


            Unfortunately, VMs aren't an option for us right now (though that would be nice and simple).


            I'm afraid that being new to Sysprep, I'm not familiar with how to take the above steps and implement them.  Currently, I am using the GUI for sysprep and for the deploy script without creating any reference files (everything being used by Sysprep is input via the deploy script GUI).  Is there a way to automate any of this to keep it as simple as possible for updating our images?  The other technicians who will be working with these images haven't used Sysprep either, so know even less about this than I do.  I'd really like to avoid having to rebuild the capture image from scratch every few iterations, but also have to simplify the workaround as much as I can so it's a quick and easy step in the imaging update process.


            I appreciate anything you can provide to assist with making this as simple and painless as possible.


            In the mean time, I'm going to give Microsoft the evil eye. 


            Thank you again!

            • 3. Re: Sysprep Windows 7 Activation Question

              Frank -


              I ran into the situation you described with Sysprep generating a fatal error (the logs have some of the errors you mentioned in your post), so I edited the keys you menionted and performed msdtc -uninstall (and -install), but it is still giving me the same errors after reboot.


              One note to anyone else trying this - be sure to re-enable the Administrator account prior to rebooting the machine or you won't be able to log back in!  Apparently, Sysprep gets far enough through the process to disable the Administrator account even through it doesn't finish successfully.


              If you forget to re-enable the Administrator account before rebooting, you can reboot into safe mode with command prompt and it will let you log in as the administrator - then use this command to enable the Administrator account:


              net user administrator /active:yes


              Then you can reboot and login normally.


              Now all I need to know is how to make this work.  The regedit is simple enough for me to do, but it doesn't seem to be doing the trick.  CleanupState = 2 and GeneralizationState = 7.


              What else needs to be changed?


              So close!

              • 4. Re: Sysprep Windows 7 Activation Question

                Update - I found that updating the following key was also required:



                Set to value:  1


                I did not need to perform these steps:


                     msdtc -uninstall (wait a few seconds)

                     msdtc -install (wait a few seconds)

                     Reboot the system.

                After updating the 3 registry keys, I was able to sysprep without the msdtc commands or the reboot.

                After capturing and deploying to another machine, I was able to activate Windows successfully.

                Thanks to Frank for all your help! 

                • 5. Re: Sysprep Windows 7 Activation Question
                  Frank Wils SSMMVPGroup

                  You're welcome. :) The registry key you found is the same that is temporary set by the unattend.xml setting i referenced. The msdtc install/uninstall is not always necessary, it depends on the exact error you get.



                  • 6. Re: Sysprep Windows 7 Activation Question
                    Frank Wils SSMMVPGroup

                    Ah, please mark the question as answered also.