Automating Client Installation and Upgrade
|
|
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
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
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.
- 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.
- 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.
- 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.
- 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.
- 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
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:
- quiet — runs Sysprep without displaying onscreen messages.
- nosidgen — runs Sysprep without regenerating SIDs that are already on the system. This is useful if you do not intend to duplicate the computer on which you are running Sysprep.
- reboot — automatically restarts the computer after Sysprep shuts it down. This eliminates the need for you to manually turn on the computer again.
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
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
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:
- Regenerates new SIDs for the computer.
- Starts the Mini-Setup Wizard.
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:
- End-User License Agreement (EULA)
- Regional options
- User name and company
- Computer name and administrator password
- Network settings
- TAPI settings (displayed only if a modem or a new modem device exists on the computer)
- Server licensing (server only)
- Time zone selection
- Finish/Restart
If you want to bypass these screens, you can specify certain parameters within Sysprep.inf. These parameters are listed in Table 25.6.
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
- On the Start menu, click Run, and then type:
cmd
- At the command prompt, change to the root folder of drive C, and then type :
md sysprep
- Insert the Windows 2000 Professional CD into the appropriate drive. Open the Deploy.cab file in the \Support\Tools folder.
- 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.
- At the command prompt, change to the Sysprep folder by typing:
cd sysprep
- Type one of the following, as required:
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
- 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.
- If the –reboot command-line switch was specified for auditing purposes only, the computer restarts and the Mini-Setup Wizard runs. Perform the following:
- Verify that the Mini-Setup Wizard provides the desired prompts. At this time, you can also audit the system and other applications. After the auditing is completed, run Sysprep again without the –reboot command line switch.
- 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.
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:
- 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\.
- In the [GuiRunOnce] section of the answer file, make the following the last command that is run on the computer:
%systemdrive%\Sysprep\Sysprep.exe –quiet
- 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:
- Allows you to create images that can be extended into larger disk partitions to take full advantage of hard disks that might have more space than the original hard disk on the master computer.
- Provides a way to create images on smaller hard disks.
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
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
- 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.
- 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.
Note
ConvertNTFS does not work in Sysprep.inf because this is a Text Mode–only function and Sysprep does not go through Text Mode.
- In the [Unattended] section of Sysprep.inf, include the statement:
ExtendOemPartition = 1
(or additional size in megabytes to extend the partition)
- Install Windows 2000 to the master computer. Sysprep will shut down the system automatically.
- Image the drive.
- Place the image on the target computer where the target computer has the same size system partition as the master computer.
- 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
- 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.
- Convert the file system to NTFS by using the Convert.exe tool provided in Windows 2000.
- 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:
[GuiRunOnce]
Command1 = "command line"
Command2 = "command line"
...
Commandn-1 = "Convert c:\ /fs:ntfs"
Commandn = "%systemdrive%\sysprep\sysprep.exe - quiet"
where:
- <command line> includes any commands that you need to run to install applications or configure the operating system before you image it.
- <Commandn-1> is the next-to-last command to be executed in the [GuiRunOnce] section of the answer file. This will run the "Convert" command. Because Convert cannot convert the active system to NTFS while the operating system is running, the operating system is set to do so the next time the computer restarts. Because Sysprep is the next item to run, the system will not be converted to NTFS during that process.
- <Commandn> is the last command to run on the computer. This command is Sysprep.exe. When Sysprep is run, it prepares the computer for imaging and then shuts down the computer.
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.
- In the [Unattended] section of Sysprep.inf, include the statement:
ExtendOemPartition = 1
(or additional size in megabytes to extend the partition)
- Install Windows 2000 to the master computer. Sysprep will shut down the system automatically.
Important
Do not restart the computer.
- Image the drive.
- Place the image on the target computer where the target computer has the same size system partition as the master computer.
- 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.