Using Sysprep in Windows 10

Windows 10 Hero Good
Microsoft-based operating systems have long used security identifiers (SIDs) that are uniquely generated and assigned to each computer as part of the initial setup of Windows. Each time you install Windows, a SID is given to that particular installation. If there’s more than one computer with the same SID on the same network, then this could cause problems.

To ease the deployment task of tens, hundreds, or thousands of workstations and servers, many IT administrators use cloning techniques to clone a sample operating system that’s configured with the right applications, software, and configurations to distribute it to other computers as images.
This is where the SID duplication issue becomes critical. Cloning a computer that’s either physical or virtual without regenerating the SID as part of the cloning process is not supported by Microsoft. If you’re unsure whether you’re using computers with duplicate SIDs, you can use the PsGetSid tool by Microsoft Sysinterals.
To fix this issue, Microsoft created the System Preparation tool or “Sysprep.” This tool can be used to remove system-specific information from the OS so that it can be used for imaging to multiple devices. Although other tools exist that claim to do similar things, Sysprep is the only tool that’s supported by Microsoft for this purpose.
If you would like to use Sysprep in Windows 11, check out Using SYSPREP in Windows 11 on Petri.
To run Sysprep in Windows 10, open Windows Explorer and navigate to C:\Windows\System32\sysprep. You can also just type “sysprep” in the Run command and click “Enter.”
In the Sysprep folder, double-click sysprep.exe.
In the System Preparation Tool window, click “Generalize”, click “Shutdown”, and then click “OK”. The computer generalizes the image and shuts down.

Launching the System Preparation tool. (Image Credit: Daniel Petri)
Launching the System Preparation tool. (Image Credit: Daniel Petri)

Note that Sysprep can also be executed from the Command Prompt. For example:

Sysprep /generalize /shutdown /oobe

 

The Sysprep /generalize command removes unique information from a Windows installation so that you can safely reuse that image on a different computer.
In  Windows 10, Sysprep also includes a VM mode, which generalizes a VHD that you deploy as a VHD on the same virtual machine or hypervisor. This mode supports rapid deployment of virtual machines. VM mode is supported only when you run it from inside a virtual machine. Sysprep VM mode is available only through the command line:

Sysprep /generalize /oobe /mode:vm

Once you run Sysprep, the computer will shut down after a few moments of processing the changes.
sysprep-windows10-2
Now, as the computer is in a shut-down state, you will need to clone it. You can use an image-capturing tool to capture your image, or if it’s a VM, then you just need to clone the VHD/VMDK files and deploy new VMs from these copies. When the cloned computers boots, they will display the Out Of Box Experience screen (OOBE).
sysprep-windows10-3
At this point, you’ll need to enter the correct values to prepare it for first use. Remember you can always create an answer file to automate this process.
Next, you’ll see that there are options to set the local settings for the OS, such as region, language, keyboard and time zone. Click “Next.”

Setting local operating system settings. (Image Credit: Daniel Petri)
Setting local operating system settings. (Image Credit: Daniel Petri)

Next, you’ll need to enter the Windows product key. If you want, you can skip this step at this point.
Entering the product key. (Image Credit: Daniel Petri)
Entering the product key. (Image Credit: Daniel Petri)

Next accept the software licensing terms.
sysprep-windows10-6
Click “Use Express settings” to use the default settings. If you want, you can also spend time to customize these settings now.
Express settings in Windows 10. (Image Credit: Daniel Petri)
Express settings in Windows 10. (Image Credit: Daniel Petri)


The system will now update, and the screen will change.
Getting critical updates screen. (Image Credit: Daniel Petri)
Getting critical updates screen. (Image Credit: Daniel Petri)

 
After a few seconds, setup will continue with the option to choose to use this OS as a standalone computer or to add it to a network. These settings can be changed later. Select the option that suits you, and click “Next.”
Selecting the option for who owns the PC. (Image Credit: Daniel Petri)
Selecting the option for who owns the PC. (Image Credit: Daniel Petri)

Next, you can add a Microsoft account, or you can add this information later. Enter the details and sign in, or click on skip the step.
Linking a Microsoft account to the PC. (Image Credit: Daniel Petri)
Linking a Microsoft account to the PC. (Image Credit: Daniel Petri)

Since this computer will not be joined to a domain, enter the name of the user that’s going to use the computer, and a password. You can create additional users later. Click “Next.”
Creating an account for the PC. (Image Credit: Daniel Petri)
Creating an account for the PC. (Image Credit: Daniel Petri)


At this time, the computer will use these details to prepare the operating system for first use. This may take a few moments.
Updates are done. (Image Credit: Daniel Petri)
Updates are done. (Image Credit: Daniel Petri)

 
 
Finally, the operating system is ready for use.