Sysprep your Windows OS for more than 3 times

Facebooktwitterredditpinterestlinkedinmail

It can happen, the need of re-syspreping an already syspreped machine, why ? maybe you lost your Image master. so.. you running the setup process, adding the changes you want, relocating the XML answerfile, running the sysprep with /generalize switch.. the process is running for few seconds and then the sysprep window is disappeared. well.. open the sysprep log file under \sysprep\Panther … there you will find setup error log, if the logfile contains this line :

Date Time, 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

then Microsoft say… “Hey dude, bummer…, re-create the whole image“.

well… it’s not so true… this error indicates that you syspreped the machine more then 3 times, you cant do that… if the windows system was already activated by pre OEM activation you cant even re-arm the machine.. so you have 2 problems, one – can’t sysprep anymore and probably you can’t re-arm your machine (it wont let you sysprep if you cant re-arm..).

so, first check if you can re-arm by runing the slmgr.vbs /dlv and check the re-arm counter, if it set to zero.. you need to do the following : http://support.microsoft.com/kb/929828 (set the <SkipRearm>1</SkipRearm> like in the example, note: this option will make the product key window to appear in the setup process).

you can also try running : slmgr.vbs –rearm, to rearm Windows.

after that, let’s come back to the sysprep process.. for syspreping already syspreped machine we have to change few keys in the registry :

HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\

CleanupState:2
HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\

GeneralizationState:7

After done with the registry, do the following :

  1. Start -> Run : msdtc -uninstall (wait few seconds)
  2. Start -> Run : msdtc -install (wait few seconds)
  3. Restart the machine
  4. Check the registry for the right registry keys values
  5. sysprep with the new XML answerfile.
  6. and.. Walla !
  7. Have fun.

76 thoughts on “Sysprep your Windows OS for more than 3 times

  1. Thanks for this great article, you just saved my day!! I have fought with this issue before, but now I finally have a solution on hand. Thanks again!

  2. After spending DAYS on this problem I luckily stumbled across your blog, it seems no one else has posted this solution but you. Thanks so much!

  3. You are about to save my holidays.
    How to check how many times an image have been syspreped? as I have one image that should have been syspreped once, but I am not sure and I want to check it first (before using your how-to)

    Other question, what happen with an image syspreped more than 3 times? do I get a message at first logon or after 30days? because I do not want the machine to all come back 30days later if I make a mistake, I’d rather not sleep tonight.

    1. Hello,
      by Running the slmgr.vbs script with /dlv parameter, you could find remaining rearm count…. for ex, 3 says you can sysprep it more 3 times.
      In addition, If you sysprep more than 3 times, you won’t be able to sysprep the image, it will fail with errors.

      Good luck !

  4. FANTASTIC! I first pulled up the KB article from MS that said I had to create a new image. I knew I could find something else to save the day, and this was it.

    BIG Thanks.

  5. Just desire to say your article is as surprising. The clearness in your post is just cool and i can assume you’re an expert on this subject. Fine with your permission let me to grab your feed to keep up to date with forthcoming post. Thanks a million and please carry on the rewarding work.

  6. I set the Microsoft-Windows-Security-SPP_neutral SkipRearm to “1”. I imaged my computer. When it was finished, I ran slmgr /dlv and it had rearm count = 0. I checked the registry settings and they were, respectively, “2” and “7”. I ran the msdtc uninstall and reinstall. I restarted the computer. Regedit still shows “2” and “7” for CleanupState and Generalization. Slmgr /dlv still shows rearm count = 0. The setupact log in the Panther folder shows “successfully executed …rearmwindows without error”. I tried slmgr /rearm and it tells me that the maximim allowed number of re-arms has been exceeded and to reinstall the operating system. Did I miss something? Isn’t this exercise supposed to remedy this? Please let me know if I missed something. Thank you.

    1. –Looks like I pulled the trigger too fast on this one! I ran sysprep again, and it did not fail, so thank you!

  7. Unfortunately NONE of this stuff has worked for me. and when I re-run sysprep with the 1 in the answerfile the registry entries get reset to 1 and 4 respectivly.

        1. Try disabling windows media network sharing service. I had the same problem as you worked after i disabled it.
          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.

  8. Came across this after searching for a solution to my error logs in the sysprep folder in relation to a MDT 2012 capture.

    All I can say is exellent work man.

  9. Hello
    When I try to create image for windows 7, i entered SYSprep file and choose

    System CleanUp Action : Enter System Audit Mode
    then i checked the Generalize
    Shutdown Option : Reboot

    then i clicked OK.

    After it finished the windows restart and it could be reboot. it says Windows prepared for the first time with error installation can not complete please restart and try again
    after 2-3 times i have the same but without error but keeping restart without reboot

    Please i need help in that

  10. “Sysprep your Windows OS for more than 3 times | IT in a
    box” was indeed definitely engaging and helpful! In the present day world honestly,
    that is very hard to carry out. I am grateful, Dave

  11. Now i try this procedure… If it work you are my new god…

    Clean up phase… Passed
    Generalize phase…. Passed

    Hail to new god

  12. This didn’t work for me. I followed the entire process but still can’t sysprep my image (This is happening in an enterprise image that took aproximately 4 months to complete, so you can picture the criticallity of the situation). I still get the errors that appear in that microsoft Post in the logs!

    1. i was in the same boat as you. i’m adding some software to images that my business school has been using, and building upon, for almost 2+ years now. “You must rebuild your image from scratch” is the absolute last thing you want to hear.

      Here’s what worked for me:
      All the steps as outlined by Sharon must be followed through.
      I also went and disabled Internet explorer, and a couple other misc featured windows programs via cpanel->add/remove programs
      I deleted the panther folder that is found in c/windows/system32/sysprep (note: you may want to back this up instead of deleting it completely, but I dont think it matters too much. Everything is re-created upon attempting your next sysprep)
      Unplug your network connection before you try to sysprep!

      Let me know how it goes

    2. How did you get out of the box? I know you were working back in 2013, just curious, I have been stuck for 2 months now…
      Regards

  13. NOTE: I am using a Virtual Machine for my master.

    I am taking over the creation of images and out of ignorance blew through my 3 allotted syspreps on a machine created from scratch. I verified my rearm count was 0 via the slmgr.vbs /dlv command. Then I edited the registry as instructed, ran the msdtc -uninstall and msdtc -install commands then rebooted.

    Checked the registry and the SysperpStatus settings were still there. Finally I tried the slmgr.vbs /dlv command to see if my allowed rearms were reset or not. It is still at 0.

    Rather than possibly undoing everything I have already done by attempting a Sysprep (with the added xml in the unattend.xml file) I thought I would ask. Did I miss any steps, should the rearm count be at something other than 0?

    Thanks, I have complete faith that I (we) will get it working

  14. same issue as Ed mentioned.
    just wanted to check if i got the idea right:
    if my rearm counts are over (0) does any of the above help me reset the rearm count back to 3?
    or does it only let me pass the sysprep task?

  15. I normally don’t post but this issue was driving me insane! thank you so much your fix worked and i’m back to imaging again.

  16. I’m just do not convinced where you stand helping your information and facts, nonetheless wonderful matter. I need to commit quite some time finding out a lot more and also realizing extra. Many thanks superb information and facts I’d been looking for this information in my mission.

  17. Doesn’t work, and I’m surprised it works for anybody. I’m presuming all these folks that say you’ve save my life hadn’t tried it yet and they’re dead now (or fired) because it didn’t work, and they never made it back to update. This is one of those circumstances where Microsoft I’m sure has made it impossible to alter the rearm count just like they’ve made it impossible to generate your own activation key. If you’ve had success good for you, I’m still skeptical.
    Cheers.

  18. Hi everyone; i’m just trying to follow your instruction, but when i run sysprep.exe (with or without the unattend.xml file), it give me an error message “halted with a fatal error”.

    in panther\setuperr.txt i’ve found this message

    2014-09-23 11:53:53, Error [0x0f0082] SYSPRP LaunchDll:Failure occurred while executing ‘drmv2clt.dll,Sysprep’, returned error code -2147024864[gle=0x00000020]
    2014-09-23 11:53:53, Error [0x0f0070] SYSPRP RunExternalDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = -2147024864[gle=0x00000020]
    2014-09-23 11:53:53, Error [0x0f00a8] SYSPRP WinMain:Hit failure while processing sysprep cleanup providers; hr = 0x80070020[gle=0x00000020]

    another thing that i’ve seen is that in the regedit

    HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\

    the value of cleanupstate and generalizationstate turn inevitabily to old value (1 and 4)

    if someone could help me, wrote me!

  19. If this solution doesn’t work, do the above but also install microsoft security essentials then sysprep. This has worked for me twice now. I don’t know what security essentials does to rearm the PC for sysprep.

  20. Years later this is still the only solution available on the web. I poured through dozens of sites and they all had pieces of the answer but only you had it all. Thank you sir, you saved me hours of work.

  21. I can confirm that this is a definitive solution and does in fact work very well. Thank you very much! Saved me so much time!

  22. Dang, how am I the only person not understanding this part.

    Do I have to do this: “you need to do the following : http://support.microsoft.com/kb/929828 (set the 1 like in the example, note: this option will make the product key window to appear in the setup process).”

    IOW, do I have to run sysprep with an unattend file with the skip rearm steps before I proceed with the next steps? “you can also try running : slmgr.vbs –rearm, to rearm Windows. after that, let’s come back to the sysprep process.. for syspreping already syspreped machine we have to change few keys in the registry…”

    Or do I just perform the reg. edits and the steps that follow?

    Thanks

  23. I suffered the sysprep ‘fatal error’ issue and tried *everything* that anyone has suggested here and elsewhere:
    – varations on slmgr -rearm advice
    – c:\windows\system32\sysprep, delete skiprearm=1
    – msdtc -uninstall
    – msdtc -install
    – Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\, changed SkipRearm to 1
    – disconnected ethernet cable
    – turned off the Windows Media Player sharing with net stop WMPNetworkSvc
    etc., etc.

    Turns out what I should have done rather than googling is checked the sysprep log:
    Windows\System32\Sysprep\Panther\setuperr.log

    I had three lines, one of which was:
    2012-11-01 13:45:15, Error [0x0f0085] SYSPRP LaunchDll:Could not load DLL c:\Program Files\Microsoft Security Client\MSESysprep.dll[gle=0x0000007e]

    Then I recalled that I’d re-used a previous sysprep image for another purpose that had Microsoft Security Essentials and uninstalled it prior to loading it up on this system.

    I then evaluated:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Sysprep\Cleanup

    And the last key was:
    “2D153B43-11B4-461F-AA43-832B2C8B8872″=”c:\\Program Files\\Microsoft Security Client\\MSESysprep.dll,DllSysprep_Cleanup”

    After granting full permissions to administrator and deleting that key, I was able to sysprep / generalize without issue.

  24. Thanks a lot for this solution! That saved me Days… Weeks… Months 🙂 i integrated this in my MDT Image creation process =) ….

  25. try to make SYSPREP many times on windows 10, version 1703, but facing error, any Help?

    sysprep was not able to validate your windows installation. review the log file

Leave a Reply to meble łazienkowe Cancel reply

Your email address will not be published. Required fields are marked *