Sysprep Capture of Windows 10 fails
(Last updated on August 2, 2018)
Since November 2015, the ISO of Windows 10 has included more “modern” applications in its default build. This has caused some problems when trying to capture an image using SYSPREP. Some of the applications are 3rd party such as Candy Crush, and Twitter, but others are Microsoft applications. The example used below occurred when using a Windows 10 x64 Enterprise edition 1511.2 ISO. I’ve also encountered the same problem on x86 versions and education builds of Windows 10.
The general error that you’ll see on the screen is:
Expected Image state is IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE, actual image state is IMAGE_STATE_COMPLETE, sysprep did not succeed.
It will give you the path for the sysprep logs which tell you where the problem lies.
If you look near the bottom of the logs you’ll see that there are some error messages that mention a certain application. In this example it is Microsoft.CommsPhone.
At this point, if you are trying to capture from a physical machine, you will need to start the entire build from scratch. If you are capturing from a VM, and remembered to create a snapshot/checkpoint before starting the capture process, you can revert to that image, and remove the offending application.
Log in as an admin and open a PowerShell console as administrator. Instead of typing in the entire name for the app you can use * as a wildcard.
Check that there aren’t multiple apps that would be detected with your wildcard:
You should just see details for a single app as shown below
To remove the app run the following powershell command:
Finally, check that it’s gone by running the first line again:
This time no results should be shown.
At this point you can run the capture again and hopefully it will go through. Be prepared as it might happen again but with a different application. Run through the above procedure until you can capture the image successfully!
For more information on how you can prevent this error, I recommend reading the following blog: https://blogs.technet.microsoft.com/mniehaus/2018/04/17/cleaning-up-apps-to-keep-windows-10-sysprep-happy/