When and How to use Sysprep

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

  1. Open Command Prompt as Administrator
  2. Navigate to C:\Windows\System32\Sysprep\ – type cd \Windows\System32\Sysprep:
     Command Prompt Using sysprep
  3. 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:
     sysprep command line help
  4. For this demo we will concentrate on the GUItype sysprep to open the sysprep tool GUI:
     Sysprep GUI
  5. 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.
    • 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
  6. We will run Sysprep with OOBE, Generalize and reboot options enabled. Select those options:
  7. Click next to start the sysprep:
  8. The System will now reboot:
  9. Once Complete, set the settings as you require and then accept the licence:
  10. Your System will now boot as an OOBE sysprepped image:
  11. 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