Make it work: Preparing Windows 10 deployment for Sysprep

Part of the process used in creating a Windows image that can be deployed to multiple PCs is using Sysprep to generalize the image. Sysprep removes the system ID (the computer’s SID) from the Windows installation so that it can be safely cloned.

Those who have worked in IT for a long time know that Sysprep has been around for decades. Unfortunately, the tool is starting to show its age. If you have ever tried to use Sysprep to generalize a Windows 10 deployment, you have likely received an error message similar to the one shown in the screenshot below. So let’s take a look at why Sysprep tends to be so problematic, and what you can do to get around these potential errors.

Sysprep
If you try to generalize a Windows 10 deployment using Sysprep, you are likely to receive an error message like the one you see above.

Sysprep errors in Windows 10 are very often tied to the existence of modern Windows applications (Metro apps, Windows Store apps, or whatever Microsoft is calling them this week). Getting a handle on these apps is key to making Sysprep work.

In preparation for this article, I set up a virtual machine and installed a clean copy of Windows 10. You can see this Windows installation in the image below. One of the first things that I am sure that you will notice is all of the bloatware that is installed by default. Keep in mind that I didn’t install a consumer edition of Windows. This edition is geared toward businesses. Hence, an administrator who wishes to Sysprep this image probably wants to first remove Netflix, Candy Crush Saga, and all of the rest of the garbage that is completely out-of-place in a business environment.

Sysprep
While getting rid of the unwanted applications and possibly installing a few business apps prior to running Sysprep sounds like a sound strategy, there is a problem with doing so. According to Microsoft, “installing new Microsoft Store apps or updating your existing Microsoft Store apps before generalizing a Windows image will cause Sysprep to fail.”

In other words, the very existence of the unwanted applications can in a roundabout way cause Sysprep to fail, because once Windows has been installed it almost immediately launches into an update cycle, and the update process can break Sysprep.

If you want to deploy and then Sysprep Windows, then my advice is to begin the process by downloading the most current deployment image possible. Since updating Windows before running Sysprep tends to cause problems, it is best to start out with an up-to-date deployment image, so as to minimize the updates that are going to be required later on.

Installation process

As for the installation process, install Windows into a virtual machine just as you normally would, but with one caveat. Before you begin the installation process, disconnect the virtual network adapter. This will prevent Windows from downloading any updates. When Windows is installed in this way, the Start menu will appear somewhat incomplete, as shown below.

SysprepFire up PowerShell

Now you can begin removing the unwanted application packages. There are a few different ways of doing this, but I personally prefer to use PowerShell. From an administrative PowerShell session enter the following command:

Get-AppxProvisionedPackage -Online | Select-Object PackageName

This command lists all of the application packages that are currently installed. You can remove a package by using this command:

Remove-AppxProvisionedPackage -Online -PackageName <package name>

You can see what these commands look like in the next image. It is worth noting that I am using copy and paste to help reduce the amount of typing required when entering package names. It is also worth noting that you don’t have to remove every package. Some packages, such as the calculator, may have business value.

Remove the applications

Now that the unwanted application packages have been removed, it is time to remove the actual applications. To do so, you can use these commands:

Get-AppxPackage | Select-Object Name
Get-AppxPackage *name* | Remove-AppxPackage

The first command lists all of the applications that are installed, while the second command performs the removal of a specific application (replace *name* with the application package). You can see an example of this below.


By the time that you get done, the Windows desktop will probably look something like what you see below. As you can see in the screenshot, there may be a few leftover start menu tiles that you have to manually remove.

Sysprep
After a few mouse clicks, the unwanted tiles are gone.


Now it’s time to try running Sysprep again. This time, Sysprep is able to generalize Windows without any issues. When you run Sysprep, be sure to choose the option to shut down the PC once Sysprep completes.


Key to making Sysprep work

As you can see, the key to making Sysprep work with Windows 10 is to disconnect the network adapter to prevent any updates from being installed, remove any unwanted apps, and avoid installing any modern applications. Supposedly, it is possible to install applications prior to performing a Sysprep so long as you sideload those applications, but I have never tried it, so I don’t know if the technique actually works or not.

If you have taken the time to work through the process of preparing a PC for Sysprep, then you have no doubt noticed that the preparation process is tedious and time-consuming. If you find that you need to use Sysprep to create new images on a periodic basis, then I would strongly recommend creating a PowerShell script that automates the cleanup process. Building such a script would involve a little bit more time up front, but would be a huge time saver later.

Featured image: Shutterstock

2 thoughts on “Make it work: Preparing Windows 10 deployment for Sysprep”

  1. This article misses the entire reason people have these issues in the first place: Not using Audit Mode!

    If you enter Audit Mode (Ctrl+Shift+F3 at the initial OOBE), you will never have these issues. The in-box apps do not provision when you’re logged in with the built-in administrator account, which is what Audit Mode uses. The errors mentioned in the article happen if you set up a local user account through the OOBE, which then gets the in-box app provisioning process underway, and later throws sysprep into a tizzy.

    From 1507 up to 1809 over the years, I’ve never had a single sysprep failure.

  2. Mark Van Noy

    AC has a solid point concerning using Audit Mode. However, complex thick images benefit from being able to validate the image and all of its settings prior to Sysprep and capture. This is particularly true of kiosk or lab environments. I received confirmation from Microsoft some years ago that this problem has existed since AppX was introduced in Windows 8. Microsoft did not suggest I change our processes to only use Audit Mode.

    Shameless self promotion; Another Techgenix article on this topic:
    https://techgenix.com/resolving-sysprep-problems-app-x-packages-part-1/
    https://techgenix.com/sysprep-problems-app-x-packages/

Leave a Comment

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top