Windows Server How-To
How To Make Sysprep Work with Windows 10, Part 2
If things do go wrong with your Windows 10 template, here's how to fix it (most of the time).
In the first part of this article series, I explained that I initially had trouble getting Virtual Machine Manager to create a template from a virtual machine that was running Windows 10. After applying some updates to my Virtual Machine Manager server, I was able to create a template, but the template produced virtual machines with non-functioning Start menus. Furthermore, I was still unable to manually run Sysprep on the virtual machine, which seemed strange since I used the Sysprep.exe file that was included with the Windows 10 operating system.
After spending a lot of time researching the problem, I found that my issues were related to the virtual machine's local user profiles. One of the big hints came from an MSDN article in which Microsoft warns customers not to update their Windows Store apps prior to running Sysprep because the associated package will be provisioned for a single user, not all users
At first, this article and a few others seemed to suggest that running Windows Update prior to running Sysprep might be causing the problem. However, I tried the process again using a brand new virtual machine with no network connectivity (so as to prevent any updates from being installed) and experienced the same problem.
Further trial and error revealed that the very presence of a local user profile was causing the problem. Unfortunately, creating a Windows 10 deployment without a user profile simply was not an option. During the installation process, Setup asks you to sign into a Microsoft account, but gives you the option to skip this step, as shown in Figure 1. If you do skip the sign in process, then the next screen forces you to provide a name for a local user.
I spent over a week working on a solution to the Sysprep problem. I have yet to come up with something that works in every conceivable situation. However, I do have a base solution that seems to work about 90 percent of the time, and I have a number of different workarounds that you can use when things go wrong.
My solution is fairly simple. Install Windows and then log in using one of the default local accounts. Next, stop the Tile Data Model Service. After doing so, you should be able to run Sysprep. Of course, if things were really that easy then this would be a very short post. As simple as stopping a service and running Sysprep sounds, there are some gotchas.
Windows 10 does something that, to the best of my knowledge, previous versions of Windows did not do. It monitors system services and automatically restarts any stopped services. This makes stopping the required service a little tricky (disabling the service isn't an option). So here is what I recommend:
Open an elevated Command Prompt window and enter the following commands:
When the Sysprep dialog box opens, set the System Cleanup Action to Enter System Out of Box Experience (OOBE). Make sure that you select the Generalize checkbox and set the Shutdown Options drop down list to Shutdown, as shown in Figure 2. Don't actually perform a Sysprep just yet.
Now, enter the Services.msc command at the computer's Run prompt. When the Service Control Manager opens, stop the Tile Data Model Server service. When the service stops, click Refresh. You will see that the service has restarted. Stop the service again, and click Refresh again. Once again, the service will have restarted. You will need to repeat this process for about five or six times until the service stops without restarting. Once the service has stopped, be sure to click Refresh at least three or four times to make sure that it has really stopped. Now, quickly switch over to your Sysprep window and run Sysprep. You must do this quickly because the service that you stopped will not remain stopped indefinitely. If the service starts back up during the Sysprep process, Sysprep will fail.
What Went Wrong?
As I said earlier, I spent over a week doing trial and error testing. In doing so, I found that not every configuration is identical and that sometimes this procedure doesn't work. When that happens, there are some possible workarounds.
If you find that Sysprep fails, even after using the procedure described above, go to the C:\Windows\System32\Sysprep\Panther folder and delete the four files in the folder (leave the IE folder). Now, run Sysprep again (make sure that the Tile Data Model Server service is still stopped). When Sysprep fails, go back to the C:\Windows\System32\Sysprep\Panther folder and open the Setupact.log file. This log file should provide some clues as to the cause of the problem.
I have found that if I update Windows 10 prior to running Sysprep then some of the third-party apps that Microsoft installs by default tend to cause problems. I have gotten around these problems by uninstalling Candy Crush Soda Saga and Twitter. The previously mentioned log file will specifically list any app that is causing issues.
If this does not fix the problem for you, then try sysprepping the system before running Windows Update. In my tests, that has fixed the problem in every situation. The down side, of course, is that any new deployments that you create from the sysprepped image will need to be patched with the latest updates.
Brien Posey is a 19-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site.