Automating Client Installation and Upgrade

Previous Topic Next Topic

Using Sysprep to Duplicate Disks

Disk duplication is a good choice if you need to install an identical configuration on multiple computers. On a master computer, you install Windows 2000 and any applications that you want installed on all of the target computers. Then you run Sysprep to transfer the image to the other computers. Sysprep prepares the hard disk on the master computer for duplication to other computers and then runs a third-party disk-imaging process. This method decreases deployment time dramatically compared to standard or scripted installations.

To use Sysprep, your master and target computers must have identical HALs, Advanced Configuration and Power Interface (ACPI) support, and mass storage controller devices. Windows 2000 automatically detects Plug and Play devices, and Sysprep redetects and reenumerates the devices on the system when the computer is turned on after Sysprep has run. This means that Plug and Play devices, such as network adapters, modems, video adapters, and sound cards do not have to be the same on the master and target computers. The major advantage of Sysprep installation is speed. The image can be packaged and compressed; only the files required for the specific configuration are created as part of the image. Additional Plug and Play drivers that you might need on other systems are also created. The image can also be copied to a CD and distributed to remote sites that have slow links.


note-icon

Note

Because the master and target computers are required to have identical HALs, ACPI support, and mass storage devices, you might need to maintain multiple images for your environment.


important-icon

Important

When performing disk duplication, check with your software vendor to make certain that you are not violating the licensing agreement for installation of the software that you want to duplicate.

Overview of the Sysprep Process

This section describes the process of building a source computer to use for disk duplication.

  1. Install Windows 2000. – Install Windows 2000 Professional on a computer that has hardware similar to the intended target computers. While building the computer, you must not join it to a domain, and you must keep the local administrative password blank.
  2. Configure the computer – Log on as the administrator, and then install and customize Windows 2000 Professional and associated applications. This might include your productivity application such as Microsoft® Office 2000, business-specific applications, and any other applications or settings that you want included in a common configuration for all clients.
  3. Validate the image – Run an audit, based on your criteria, to verify that the image configuration is correct. Remove residual information, including anything left behind from audit and event logs.
  4. Prepare the image for duplication – After you are confident that the computer is configured exactly the way that you want, you are ready to prepare the system for duplication. You accomplish this by running Sysprep with the optional Sysprep.inf file, which is described later in this chapter. When Sysprep has completed, the computer will shut down automatically or will indicate that it is safe to shut down.
  5. Duplicate – At this point, the computer hard disk is triggered to run Plug and Play detection, create new security identifiers (SIDs), and run Mini-Setup Wizard the next time that the system is started. You are now ready to duplicate or image the system by using a hardware or software solution. The next time that Windows 2000 is started from this hard disk, or is started from any duplicated hard disk created from this image, the system will detect and re-enumerate the Plug and Play devices to complete the installation and configuration on the target computer.

important-icon

Important

Components that depend on Active Directory cannot be duplicated.

Sysprep Files

To use Sysprep, run Sysprep.exe manually or configure Setup to run Sysprep.exe automatically by using the [GuiRunOnce] section of the answer file. To run Sysprep, the files Sysprep.exe and Setupcl.exe must be located in a Sysprep folder at the root of the system drive (%systemdrive%\Sysprep\). To place the files in the correct location during an automated Setup, you must add these files to your distribution folders under the $OEM$\$1\Sysprep subfolder. For more information about this subfolder, see "Structuring the Distribution Folder" earlier in this chapter.

These files prepare the operating system for duplication and start the Mini-Setup Wizard. You can also include an optional answer file, Sysprep.inf, in the Sysprep folder. Sysprep.inf contains default parameters that you can use to provide consistent responses where they are appropriate. This limits the requirement for user input, thereby reducing potential user errors. You can also place the Sysprep.inf file on a floppy disk to be placed in the floppy disk drive after the Windows startup screen appears in order to allow further customization at the target computer's location. The floppy disk drive is read when the "Please Wait..." Mini-Setup Wizard screen appears. When the Mini-Setup Wizard has successfully completed its tasks, the system restarts one last time, the Sysprep folder and all of its contents are deleted, and the system is ready for the user to log on.

The Sysprep files are defined in the sections that follow.

Sysprep.exe

Sysprep.exe has the following three optional parameters:

Sysprep.inf

Sysprep.inf is an answer file that is used to automate the Mini-Setup process. It uses the same .ini file syntax and key names (for supported keys) as the Setup answer file. You need to place the Sysprep.inf file in the %systemdrive%\Sysprep folder or on a floppy disk. If you use a floppy disk, you can provide the floppy after the Windows startup screen appears. Note that if you do not include Sysprep.inf when running Sysprep, the Mini-Setup Wizard displays all the available dialog boxes listed under "Mini-Setup Wizard" later in this chapter.


note-icon

Note

If you provided a Sysprep.inf file on the master computer and you want to change Sysprep.inf on a per-computer basis, you can use the floppy disk method previously discussed.

The following is an example of a Sysprep.inf file:

[Unattended]

;Prompt the user to accept the EULA.

OemSkipEula=No

;Use Sysprep's default and regenerate the page file for the system

;to accommodate potential differences in available RAM.

KeepPageFile=0

;Provide the location for additional language support files that

;may be needed in a global organization.

InstallFilesPath=%systemdrive%\Sysprep\i386


[GuiUnattended]

;Specify a non-null administrator password.

;Any password supplied here will only take effect if the original source

;for the image (master computer) specified a non-null password.

;Otherwise, the password used on the master computer will be

;the password used on this computer. This can only be changed by

;logging on as Local Administrator and manually changing the password.

AdminPassword=""

;Set the time zone

TimeZone=20

;Skip the Welcome screen when the system boots

OemSkipWelcome=1

;Do not skip the regional options dialog so that the user can indicate

;which regional options apply to them.

OemSkipRegional=0


[UserData]

;Prepopulate user information for the system

FullName="Authorized User"

OrgName="Organization Name"

ComputerName=XYZ_Computer1


[Identification]

;Join the computer to the domain ITDOMAIN

JoinDomain=ITDOMAIN


[Networking]

;Bind the default protocols and services to the (s) network card used

;in this computer.

InstallDefaultComponents=Yes



note-icon

Note

You can change the administrative password using Sysprep.inf only if the existing administrative password is null. This is also true if you want to change the administrator password through the Sysprep GUI.

For more information about answer file parameters and syntax, see the "Microsoft Windows 2000 Guide to Unattended Setup" (Unattend.doc) on the Microsoft Windows 2000 operating system CD. The Unattend.doc file is part of the Deploy.cab file in the \Support\Tools folder. In Windows 98 or Windows 2000, use Windows Explorer to extract this document. In Windows 95 and earlier, or in MS-DOS, use the Extract command to access the file.

Setupcl.exe

Setupcl.exe does the following:

Mini-Setup Wizard

The Mini-Setup Wizard starts the first time that a computer starts from a disk that has been duplicated by the Sysprep method. The wizard gathers any information that is needed to further customize the target computer. If you do not use Sysprep.inf, or if you leave some sections of the file blank, the Mini-Setup Wizard displays screens for which no answer was provided in Sysprep.inf. The possible screens include the following:

If you want to bypass these screens, you can specify certain parameters within Sysprep.inf. These parameters are listed in Table 25.6.


note-icon

Note

Because Setup detects optimal settings for display devices, you will no longer see the "Display Settings" screen when Setup or Mini-Setup Wizard are running. You can specify the settings in the [Display] section either in the answer file that is used for your master computer or in the Sysprep.inf file used for your target computer. If settings in the [Display] section are in the answer file that is used for your master computer, Sysprep will retain those settings unless Sysprep.inf contains different settings or unless a video adapter or monitor requiring settings different from those of the master computer is detected.

Table 25.6 Parameters in Sysprep.inf for Bypassing the Mini-Setup Wizard

Parameter Value
Regional options [RegionalSettings] section

[GuiUnattended]

OemSkipRegional=1

User name and company [UserData]

FullName="User Name"

OrgName="Organization Name"

Computer name and administrator password [UserData]

ComputerName=W2B32054

[GuiUnattended]

AdminPassword=""

TAPI settings [TapiLocation]

AreaCode=425

Network settings [Networking]

InstallDefaultComponents=Yes

Server licensing (server only) [LicenseFilePrintData]

AutoMode = PerServer

AutoUsers = 5

Time zone selection [GuiUnattended]

TimeZone=<desired time zone index>

Finish/Restart N/A

Running Sysprep Manually

After you install Windows 2000 Professional, you can use Sysprep to prepare the system for transfer to other similarly configured computers. To run Sysprep manually, you must first install Windows 2000 Professional, configure the system, and install the applications. Then run Sysprep without the –reboot command-line switch. After the system shuts down, duplicate the image of the drive to the similarly configured computers.

When users start up their duplicated computers for the first time, Sysprep Mini-Setup will run, allowing the users to customize their systems. You can also preassign all or some of the Sysprep configuration parameters by using Sysprep.inf. The Sysprep folder (which contains Sysprep.exe and Setupcl.exe) is automatically deleted after Sysprep Mini-Setup is completed.

To prepare a Windows 2000 Professional installation for duplication

  1. On the Start menu, click Run, and then type:

    cmd

  2. At the command prompt, change to the root folder of drive C, and then type :

    md sysprep

  3. Insert the Windows 2000 Professional CD into the appropriate drive. Open the Deploy.cab file in the \Support\Tools folder.
  4. Copy Sysprep.exe and Setupcl.exe to the Sysprep folder.

    If you are using Sysprep.inf, also copy this file to the Sysprep folder. Note that Sysprep.exe, Setupcl.exe, and Sysprep.inf must exist in the same folder for Sysprep to function properly.

  5. At the command prompt, change to the Sysprep folder by typing:

    cd sysprep

  6. Type one of the following, as required:
  7. Sysprep

    Sysprep –reboot

    Sysprep /<optional parameter>

    Sysprep /<optional parameter> -reboot

    Sysprep /<optional parameter 1>.../<optional parameter X>

    Sysprep /<optional parameter 1>.../<optional parameter X> -reboot


  8. If the –reboot command-line switch was not specified, perform the following:

    When a message requesting that you shut down the computer appears, on the Start menu, click Shut Down. You are now ready to use a third-party disk-imaging tool to create an image of the installation.

  9. If the –reboot command-line switch was specified for auditing purposes only, the computer restarts and the Mini-Setup Wizard runs. Perform the following:

note-icon

Note

You can add a Cmdlines.txt file to the Sysprep folder, to be processed by Setup. This file is used to run post-Setup commands, including commands for application installation.

Running Sysprep Automatically After Setup Completes

The [GuiRunOnce] section of the answer file contains commands to be executed after Setup completes. You can use the [GuiRunOnce] section to create an installation that completes Setup, automatically logs on to the computer, runs Sysprep in –quiet mode, and then shuts down the computer. For this to occur, you need to do the following:

  1. To copy the files to the correct location on the system drive, include the required Sysprep files in the distribution folders under $OEM$\$1\Sysprep\.
  2. In the [GuiRunOnce] section of the answer file, make the following the last command that is run on the computer:
  3. %systemdrive%\Sysprep\Sysprep.exe –quiet


  4. If multiple reboots are required, make this the last command used the last time the [GuiRunOnce] section is used.

Using Sysprep to Extend Disk Partitions

Windows 2000 GUI Setup and Mini-Setup can be used to extend NTFS partition through the answer files. This new functionality does the following:

To determine the best way to integrate this functionality in your environment, you need to review the steps that follow and choose the method that will work best for you based on the tools that you are using to image the operating system.


caution-icon

Caution

If you can use your imaging tools to modify the image, you can delete the files Pagefile.sys, Setupapi.log, and Hyberfil.sys (if applicable) because these files will be recreated when the Mini-Setup Wizard runs on the target computer. You must not delete these files on an active system because this can cause the system to function improperly. These files should only be deleted, if desired, only from the image.

To extend a hard disk partition when using a third-party imaging product or a hardware imaging device that supports NTFS used by Windows 2000

  1. Configure the partition on the master computer hard disk to the minimum size required to install Windows 2000 with all the components and applications that you intend to preinstall. This will reduce your overall image size requirements.
  2. Include the FileSystem=ConvertNTFS in the [Unattended] section of the answer file that is used to create the master image. You do not need to include ExtendOemPartition here because you want to maintain the smallest possible image size.

  3. note-icon

    Note

    ConvertNTFS does not work in Sysprep.inf because this is a Text Mode–only function and Sysprep does not go through Text Mode.

  4. In the [Unattended] section of Sysprep.inf, include the statement:
  5. ExtendOemPartition = 1


    (or additional size in megabytes to extend the partition)

  6. Install Windows 2000 to the master computer. Sysprep will shut down the system automatically.
  7. Image the drive.
  8. Place the image on the target computer where the target computer has the same size system partition as the master computer.
  9. Restart the target computer.

    The Mini-Setup Wizard starts and the partition is extended almost instantaneously.

To extend a hard disk partition when using an imaging product that does not support NTFS used by Windows 2000

  1. Configure the partition on the master computer hard disk to the minimum size required to install Windows 2000 with all the components and applications that you intend to preinstall. This will reduce your overall image size requirements.
  2. Convert the file system to NTFS by using the Convert.exe tool provided in Windows 2000.
  3. Include the following items as the last two items of the [GuiRunOnce] section of the answer file that is used to create the master image:
  4. [GuiRunOnce]

    Command1 = "command line"

    Command2 = "command line"

    ...

    Commandn-1 = "Convert c:\ /fs:ntfs"

    Commandn = "%systemdrive%\sysprep\sysprep.exe - quiet"


    where:


    note-icon

    Note

    You cannot include ExtendOemPartition in the master answer file for this step because the partition on which the image is generated is not NTFS. You also might want to keep the image as small as possible.

  5. In the [Unattended] section of Sysprep.inf, include the statement:
  6. ExtendOemPartition = 1


    (or additional size in megabytes to extend the partition)

  7. Install Windows 2000 to the master computer. Sysprep will shut down the system automatically.

  8. important-icon

    Important

    Do not restart the computer.

  9. Image the drive.
  10. Place the image on the target computer where the target computer has the same size system partition as the master computer.
  11. Restart the target computer.

    The computer will initially start in conversion mode to convert the system partition on the target computer to NTFS.

    The computer will automatically restart.

    The Mini-Setup Wizard starts, and the partition is extended almost instantaneously.

© 1985-2000 Microsoft Corporation. All rights reserved.