Preparing and Sysprep’ing the Reference Computer

This is a follow up to my earlier post which outlined the procedure to build an unattend.xml answer file to automate the Windows 7 installation process in a deployment scenario.

In this post I will, in a nutshell, install Windows 7, boot into audit mode, customize the installation and prepare the system for duplication using Sysprep using the answer file I built in the previous post. The result will be a Hybrid image ready to capture and deploy to target computers. 

Thick, Thin or Hybrid?

The image I will be building in this post will be a ‘Hybrid’ image, essentially a cross between a ‘thick’ image (OS + drivers + plug-ins + applications) and a ‘thin’ image (OS only). This hybrid image will only have a few essential plug-ins installed while other applications will be installed straight after deployment as a post-imaging task using Fog’s snap-in feature.

Install Windows 7 and Boot into Audit Mode

The first step to building our image is to install a fresh copy of Windows 7 on the reference computer and boot into audit mode. So to get started install Windows 7 as normal, when you arrive at the welcome screen and it asks you to create a username, hit Ctrl+Shift+F3 on the keyboard. This will log you into the local admin account in audit mode.

Audit mode is where you’re logged onto the local administrator account in Windows 7 to customize the installation before capturing and deploying the image to target computers. I quite like the idea of starting off with a fresh, clean installation of Windows 7 to boot into audit mode before creating user accounts. This way the only user profile on my system will be the local administrator profile which can then be copied to the default user profile as part of the Sysprep process. The Sysprep process will only copy the local administrator profile to the default user profile; hence creating user accounts makes things a bit messy.

While in audit mode we can start customising the user profile and also customise the Windows 7 installation itself.

Customize the Administrator Profile

Start customizing the administrator account with your own wallpaper, screensaver, desktop icons, etc. The local administrator accounts user profile will eventually be used as the default user profile when deployed to target computers. This way every user will have the same wallpaper, screensaver, etc. In a working environment these may be customised with logos and themes to complement the company’s brand, etc.

Customize the OS

How far you go with customizing the Windows 7 installation itself will depend on your working environment. Best practices and desktop build policies set by the IT department will dictate what Windows services, features and components are to be available for use on client computers. As with creating a default user profile, having a customized OS ensures all client computers have a common build and users have a common desktop experience.

For my build I will be removing some Windows components and disabling a few features as follows:

Removing Windows features

  • Internet Explorer
  • XPS Services, XPS Viewer
  • Games
  • Windows Media Player
  • Windows Media Center
  • Windows Gadget

Disabling services, etc

  • User Account Control
  • Remote Assistance

Install plug-ins:

  • Flash player
  • Shockwave player
  • DivX Plus
  • Foxit Reader

Install the Fog Service

I’ll be using Fog (a linux-based cloning solution) to capture and deploy my image and also carry out post-imaging tasks on the target computer at the time of deployment. To do that I need the Fog service installed and running.

Hence I will need to install and run the Fog service on my reference computer so it’s available on all target computers after deployment.

Drivers:

I will not install any device drivers – instead my unpacked drivers (no exe’s) will be copied in the following directory:  C:\Windows\INF\MyDrivers

The Chipset, Audio and Ethernet drivers will reside in their own subfolders within a folder called “HP DC5800” (the model name of the reference computer) in the above directory. Setup searches for available drivers in the C:\Windows\INF\ directory (and all subdirectories) when installing Windows 7. So in this case when the image is deployed to target computers, Setup will search and find the Chipset, Audio and Ethernet drivers and install them ready to use out of the box.

Sysprep’ing the System

In this final step we generalize the system by running Sysprep, which essentially removes everything that’s unique to this computer, which includes the security identifier, drivers, the hostname and more. This prepares the system to be captured as an image and deployed to multiple computers of the same hardware, known as target computers.

To automate the deployment process you will need an answer file such as the unattend.xml file I built in my previous post which essentially provides answers to all the GUI screens when installing Windows 7, such as keyboard, system language, time zone, Windows updates, etc.

First, a little housekeeping:

After Sysprep is run using an answer file and the image is captured and deployed to target computers, the Setup process to apply the settings from the answer file leaves copies of the unattend.xml file on the target computers. Hence we need a script to delete these.

Create a folder called “Scripts” in C:\Windows\Setup\
Open notepad, type in the following two lines and save it as SetupComplete.cmd in the folder you just created

del /Q /F C:\Windows\System32\Sysprep\unattend.xml
del /Q /F C:\Windows\Panther\unattend.xml

The SetupComplete.cmd script is the first thing that runs before users get the chance to log on (after Setup finishes installing and applying the settings) so it’s ideal for housekeeping  tasks like this.

Sysprep with the answer file

Browse to C:\Windows\System32\Sysprep
Copy the unattend.xml file in this directory (make sure it’s called unattend.xml)
Hold SHIFT and right click on an empty space within this directory and select “Open New Command Window Here”
Type the following at the command prompt:

Sysprep /generalize /oobe /shutdown /unattend:unattend.xml

Running the above command will generalise the system and shutdown the computer. You are now ready to capture the image, but remember if you turn on the computer and boot into Windows (even if it only goes up to the Windows logo screen) before capturing the image you will have to Sysprep the system again. Check out my YouTube video for a quick ‘how to’ on capturing an image using Fog.

Next post: Deploying applications using Fog snap-ins

3 thoughts on “Preparing and Sysprep’ing the Reference Computer

Leave a comment