Problem:
When triyng to perform a image capture of a Windows 7 client using a SCCM 2007 CD I received the message “Task Sequence: Image Capture Wizard has failed with error code (0x80004005)….”
Also when I tried to run Sysprep.exe manually from C:\Windows\System32\sysprep I received the error “A fatal error occurred while trying to sysprep the machine”
And in the C:\Windows\System32\sysprep\Panther\setuperr.log I found the below errors;
[0x0f0073] SYSPRP RunExternalDlls:Not running DLLs; either the machine is in an invalid state or we couldn't update the recorded state, dwRet = 31 [0x0f00ae] SYSPRP WinMain:Hit failure while processing sysprep cleanup external providers; hr = 0x8007001f Cause:
Cause:
After a little digging I found that my problem was caused due to Microsoft only allowing you to Sysprep a machine 3 times.
Microsoft’s official line is after you have syspreped 3 times you need to create a new image.
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 any more and probably you can’t re-arm your machine (it wont let you Sysprep if you can’t re-arm.).
Workaround:
- First run slmgr.vbs /dlv and check the re-arm counter towards the bottom is zero
- If it is not zero then you may be able to get away with running slmgr.vbs –rearm else you will need to use an unattend.xml file
- Either add the below to your existing unattend.xml or there is an example unattend.xml at the bottom of his post. Save the unattend.xml file to C:\Windows System32\sysprep
<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"> <SkipRearm>1</SkipRearm> </component> </settings>
- Run slmgr.vbs –rearm
- Use regedit and navigate to HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\ and change CleanupState to 2 and GeneralizationState to 7
- Start => Run : msdtc -uninstall (wait few seconds)
- Start => Run : msdtc -install (wait few seconds)
- Restart the computer
- Try Sysprep or SCCM again and you should be OK
Notes:
- Using this unatten.xml will make the product key window appear during the setup
- The SCCM task sequence message can also be caused on its own, if you don’t have the SCCM client installed.
References:
http://blogen.creed-tech.net/miscellaneous/sysprep-your-windows-os-for-more-then-3-times/
http://support.microsoft.com/kb/929828
http://support.microsoft.com/kb/947212
Example unattend.xml File
<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <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"> <SkipRearm>1</SkipRearm> </component> </settings> </unattend>
Thank you very much. You saved my day.
Thank you for the procedure. It worked for me too.
Just a point to note, I had to type out that unattend.xml file from your example (it’s going onto a disconnected system. Your sample above is missing the root element, took me a while to pinpoint that error.
Thank you for the advice this is still very much happening today two years later. I’ve been trying to sysprep Windows 8.1 I had two major issues, McAfee agent and I had disabled the Windows Store Service. Once McAfee Agent was removed and the service changed to manual I was able to sysprep without issue.
It took days to track this one down.
Without the notes above the retrying process would have been that much worse. Thanks