Sysprep is the Microsoft system preparation tool used by system administrators often during the automated deployment of Windows Server based operating systems. Sysprep is most frequently used in virtualized environments to prepare a system image which will be cloned multiple times.
Typically, a system administrator creates a template for a system build and customizes the operating system to their requirements. During the build process, the Operating System allocates the server with a unique SID (System Identifier). Each time you clone the system image/template, you will also clone the SID.
In a Microsoft Windows Server network, duplicate SIDs can cause problems. Issues such as WSUS incompatability, Volume Licence key activation problems as well errors in Microsoft Office products. Other non Microsoft products such as Citrix do not work correctly on environments with duplidated SID.
If a template, or system image is used, System administrators must run the Sysprep tool to clear the SID information. The Sysprep tool is usually one of the last tasks performed by a system administrator when building a server image/template, that way each clone of the template will generalize a new unique SID for every server image copied from the template and will prepare the server for a first time boot.
The end result is a System template that functions as a new unique build every time it is deployed.
Step by step guide to run Sysprep
In the example below we will be using Windows Server 2012 R2. Sysprep is a hidden tool and can only be run from the command prompt by an Administrator
- Open Command Prompt as Administrator
- Navigate to C:\Windows\System32\Sysprep\ – type cd \Windows\System32\Sysprep:
- Sysprep can be run in 2 modes, the GUI mode or command line. If you wish to explore the command line type Sysprep /h and it will give you all the modes available for the command line:
-
For this demo we will concentrate on the GUI – type sysprep to open the sysprep tool GUI:
- There are only 3 options to consider in the GUI
-
System Cleanup Action
-
Enter System Out-of-box Experience (OOBE)
- This is the most commonly used feature of Sysprep which essentially prepares the server as if it is the first time it has been powered up.
-
Enter System Audit Mode
- Audit mode will automatically start the computer as the local administrator
- Adminsitrator account is disabled after first logon automatically
- The Server will always boot audit mode until told to boot OOBE
- If a password protected screensaver starts – you are locked out full stop
- Audit mode is used to create a highly customisable version of operating system often with 3rd party tools.
-
Enter System Out-of-box Experience (OOBE)
-
Generalize
- Generalized the SID – this is a requirement when deploying master images
-
Shutdown Options
- Quit – quit the sysprep tool
- Reboot – once sysprep completes, reboot the server
- Shutdown – once sysprep completes, shutdown the server
-
System Cleanup Action
- We will run Sysprep with OOBE, Generalize and reboot options enabled. Select those options:
- Click next to start the sysprep:
- The System will now reboot:
- Once Complete, set the settings as you require and then accept the licence:
- Your System will now boot as an OOBE sysprepped image:
- Alternatively, You can chose the shutdown option (instead of reboot) and then save this as a template to deploy as many times as you please:
Read related articles
A Guide to PowerShell – part 3
Welcome to part 3 of 3 of The Solving A guide to PowerShell. Check also Part 1 and Part 2.
A Guide to PowerShell – part 2
Welcome to part 2 of 3 of The Solving A guide to PowerShell. Click here for Part 1 and Part
A Guide to PowerShell – part 1
Welcome to part 1 of 3 of The Solving A guide to PowerShell. Click here for Part 2 and Part