Grab our RSS feeds Follow us on Twitter Join our Facebook Group Connect with us on LinkedIn
myITforum.com, Powered by You.
you are not logged in

Articles

Newslinks

Links

Downloads

Site Services

Community Forums

Discussion Lists

Article Search

Newsletter

Web Blogs

FAQs

Live Support

myITforum TV

Take a Poll

Monthly Drawing

myITforum Network

User Group Directory

Our Partners

About Us

Register

Login

BRONZE PARTNER:

BRONZE PARTNER:



Industry News:




  Home : Articles : Miscellaneous print | email | | Forums |   print | email | | Blogs |   print | email | | Wiki |   print | email | | FAQs |   print | email | Article Search  
SysPrep


Bookmark and Share

By: Janis Keim
Posted On: 1/22/2003

SysPrep
Are you in charge of imaging workstations at your company? Do you have multiple hardware platforms deployed throughout your company? Do you maintain more than 5 images of those workstations? If you answered yes to these questions, then this document might just ease your workload.

The purpose of this document is to assist Systems Administrators in reducing the number of PC images that are maintained on a daily basis, by using Microsoft’s SysPrep utility.

The Process

  1. On the lowest platform (oldest hardware) deployed at your company, install the operating system and leave administrator account password blank. Note: If you don’t leave the administrator password blank, it will get passed, in plain text, via the SysPrep.inf file.

    a. Name: CompanyName
    b. Organization: CompanyName
    c. Computer Name: XXXX (whatever you want)
    d. Admin Password: (leave blank)

  2. Create administrative equivalent account called Test with a password.
    a. UserID: test (whatever you want)
    b. Password: test! (whatever you want)

  3. Network Options – check the radio button that reads
    a. Users must enter a user name and password to use this computer.
    b. Leave the machine connected to the WORKGROUP.

  4. Once the operating system is installed, build new image from scratch, using the Test account. This should include all software that is to be included in the image.

  5. In the interest not having to rely on hindsight, you might want to burn an image of your machine before you start applying the SysPrep files. That way, if something goes wrong with the SysPrep process, you still have a valid image and won’t have to reinstall all the software again. Note: Just make sure to keep this image separate from all other SysPrep-generated images. You might even want to name the image “NoSysPrep”.

  6. Create C:\SysPrep folder on machine. Copy these files to that newly created folder.

    SysPrep.exe – prepares hard disk on master computer for duplication

    setupcl.exe – regenerates new SIDs for the computers

    pnpids.exe - retrieve the PnP IDs for your network cards

    SysPrep.inf – the answer file to be used

  7. Since Sysprep enumerates all hardware the first time the cloned PC boots up, you may need driver files for some PNP and Non-PNP hardware if the drivers don't come with your OS installation files. If this is the case, you can create a driver directory under C:\sysprep. In the driver directory, create a separate folder for each device that needs drivers installed. For example, if you need to add drivers for your video card and NIC, you could create: C:\sysprep\drivers\video and c:\sysprep\drivers\nic. The space you allocate for this folder will be reclaimed after Sysprep Mini-Wizard is completed.

    Important: If the hard drive controller(s) in your destination PC(s) are different than your Master PC, you have to indicate in the sysprep.inf file how to locate the .inf file for those controller(s). See the NewSysprep.doc file that comes with sysprep1.1 for an explanation of how to do this. There are also example *.inf files will aid you in doing this.

  8. Once all drivers have been copied locally, logout of test account and logon as Administrator. The password should still be blank at this point.

  9. Delete Test Profile.

    a. Right mouse on My Computer | Properties
    b. From the User Profiles Tab, highlight the Test account and press DEL.

  10. Delete Test Account

    a. Right mouse on My Computer | Manage
    b. Expand Local Users and Groups
    c. Highlight Test account and press DEL

  11. Run Disk Cleanup

    a. Start | Programs | Accessories | System Tools | Disk Cleanup

  12. Remove a couple entries in the registry to keep base image “tidy”.

    a.HKLM\Microsoft\Windows\CurrentVersion\RecentDocs

    b.HKLM\Microsoft\Windows\CurrentVersion\RunMRU

  13. Change Administrator password.

  14. From the cmd prompt, run C:\SysPrep\SysPrep.exe /pnp

    a. By running the SysPrep.exe utility, the PC will be powered down once you click OK.

  15. Upload the current image, including SysPrep, to the server.

  16. At reboot, the SysPrep mini-wizard will run and find all drivers for each particular piece of hardware.

Hardware Drivers

To help maintain a more stable operating system, make sure to download the latest drivers for each piece of hardware to be cloned, although duplicate drivers are not necessary. If the video card is the same in all PCs to be cloned, including the master PC, then you need only download the latest drivers and place them in the driver folder. Make sure you include the driver files, *.inf, and *.cat files for each piece of hardware. Do not copy any binary files that your hardware manufacturer created to update your hardware.

SysPrep.inf Explained

The key to making SysPrep work on multiple hardware platforms lies within the SysPrep.inf file and the command used to invoke the SysPrep.exe utility. Text in bold and italics are taken directly from the SysPrep.inf file. Explanation for each section follows.

The key to SysPrep lies within the [SysprepMassStorage] section of the .inf file.

[SysprepMassStorage]
Primary_IDE_Channel = %windir%\inf\mshdc.inf
Secondary_IDE_Channel = %windir%\inf\mshdc.inf


The two strings above tell the operating system where to look for the IDE drivers. If you notice when you run a full blown setup from any Windows setup disk, it goes out and looks for the default IDE drivers for the primary and secondary IDE before the GUI. After it finds the default, it will continue on with whatever task it needs to perform. After all the files have been copied over and the setup is completed, it then will either keep the default IDE drivers or look for a more updated one from the path you provided in the answer file. Rarely does it ask you for an updated one, unless you have another IDE controller installed beside the primary and secondary.

PCMCIA\*PNP0600=%systemroot%\inf\mshdc.inf
*PNP0600=%systemroot%\inf\mshdc.inf
PCMCIA\KME-KXLC005-A99E=%systemroot%\inf\mshdc.inf
PCMCIA\_-NinjaATA--3768=%systemroot%\inf\mshdc.inf
PCMCIA\FUJITSU-IDE-PC_CARD-DDF2=%systemroot%\inf\mshdc.inf
*AZT0502=%systemroot%\inf\mshdc.inf
PCI\CC_0101=%systemroot%\inf\mshdc.inf
PCI\VEN_10B9&DEV_5215=%systemroot%\inf\mshdc.inf
PCI\VEN_10B9&DEV_5219=%systemroot%\inf\mshdc.inf
PCI\VEN_10B9&DEV_5229=%systemroot%\inf\mshdc.inf
PCI\VEN_1097&DEV_0038=%systemroot%\inf\mshdc.inf
PCI\VEN_1095&DEV_0640=%systemroot%\inf\mshdc.inf
PCI\VEN_1095&DEV_0646=%systemroot%\inf\mshdc.inf
PCI\VEN_0E11&DEV_AE33=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_1222=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_1230=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_7010=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_7111=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_2411=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_2421=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_7199=%systemroot%\inf\mshdc.inf
PCI\VEN_1042&DEV_1000=%systemroot%\inf\mshdc.inf
PCI\VEN_1039&DEV_0601=%systemroot%\inf\mshdc.inf
PCI\VEN_1039&DEV_5513=%systemroot%\inf\mshdc.inf
PCI\VEN_10AD&DEV_0001=%systemroot%\inf\mshdc.inf
PCI\VEN_10AD&DEV_0150=%systemroot%\inf\mshdc.inf
PCI\VEN_105A&DEV_4D33=%systemroot%\inf\mshdc.inf
PCI\VEN_1106&DEV_0571=%systemroot%\inf\mshdc.inf


The strings above are unique IDE drivers. If you have an IDE controller and want SysPrep to use a different driver beside the MS default, you can put it in this section. Be very careful when doing this however. By using controller-specific drivers, as opposed to the default Microsoft drivers, you may encounter error messages about an invalid disk. If you prefer to use IDE controller-specific drivers, another option would be to place the driver setup into the run once in the answer file. This will update the IDE controller to the driver that you want it to us as well as creating a stable SysPrep run.

Another thing to consider is that a pre-configured IDE controller which is a part of your image will get overwritten by the /pnp (Plug N Play) switch used with SysPrep. There is a way around this “feature” of SysPrep, namely by not forcing PNP to run. In other words, by not using the /pnp parameter. By omitting the “pnp" parameter, only a portion of PNP will run and not the full PNP. Running the full PNP parameter, as a part of the SysPrep process, will indeed allow one image to locate and install a variety of unsupported hardware configurations. If the default MS IDE driver or the specific IDE driver is not detected, then SysPrep will not run.

[Unattended]
UnattendedMode = FullUnattended


This option means that the whole setup will not stop or pause for anything.

OemSkipEula = Yes
OemPreinstall=No


This part skips the license agreement and any subsequent prompts.

OemPnPDriversPath =
sysprep\Drivers\1\NIC;sysprep\Drivers\1\Sound\W2K;sysprep\Drivers\1\Sound;
sysprep\Drivers\1\video;sysprep\Drivers\6\NIC;sysprep\Drivers\7\NIC;sysprep\Drivers\7\Video;sysprep\Drivers\8\NIC;
sysprep\Drivers\8\Sound;sysprep\Drivers\8\Video;sysprep\Drivers\Evo\3cOXNic;sysprep\Drivers\Evo\IntelNic;
sysprep\Drivers\Evo\Nvidia;sysprep\Drivers\Evo\Sound;sysprep\Drivers\Evo\Sound\Smaxwdm\W2k;
sysprep\VLi8\Keyboard;sysprep\VLi8\NIC;sysprep\VLi8\Sound;sysprep\VLi8\Video


This line tells SysPrep where to look for driver files not included with the operating system. We copy drivers for all types of hardware to C:\Drivers and separate them on a machine to machine basis. As long as you reference the locations for each piece of hardware, this area will be specific to your environment and hardware.

If the image you created has all the drivers for all the different hardware, then the OEMPNPDRIVERSPATH is not needed. It is recommended to reference all drivers just in case the manufacturer makes any hardware changes. All drivers must be copied into the SysPrep folder on the hard drive. The space is lost for the image, but will be reclaimed after SysPrep finishes since it automatically deletes itself. Just make sure the drivers you need are within the SysPrep folder.

[GuiUnattended]
AdminPassword=*
OEMSkipRegional=1
TimeZone=20
OemSkipWelcome=1


The asterisk appearing on the AdminPassword line nulls the password as blank. The good thing is if you have an admin password setup on the image, the answer file will not null out the password. Instead it will keep the administrator password the same. This allows for higher security by not entering the admin password into the answer file.

[UserData]
FullName="YourCompanyNameGoesHere"
OrgName="YourCompanyNameGoesHere"
ComputerName=xxxxxx
Productid = License info here


Replace "YourCompanyName" and "License info here" with the information specific to your company and your operating system license number.

[Display]
ConfigureAtLogon = 0
BitsPerPel = 16
XResolution = 1024
YResolution = 768
VRefresh = 75
AutoConfirm = 1


This section of the .inf file configures the video card. By configuring the screen settings, SysPrep will prevent the screen from coming up to the far right or left, and center the display. You can change it however you would like. The BitsPerPel refers to the color while the 1024x768 can be changed to 800x600 or your own resolution preference. The VRefresh needs to be checked against the hardware refresh rate. 75 Hertz should work in most cases, but sometimes 65 Hertz is better. AutoConfirm is used to confirm the change so that it doesn't change back to the default. (This was an addition and is not needed.

[Identification]
JoinWorkgroup=WORKGROUP


This configures the PC to join a workgroup. This can be changed to any workgroup name, after which the domain is joined manually or automated by some other 3rd party software.

[Identification]
JoinDomain = Your Domain
CreateComputerAccountInDomain = Yes
DomainAdmin = user_name
DomainAdminPassword = password


This section allows you to rename the PC and join a domain, but will be hard to do since you want this to be generic.

[Networking]
InstallDefaultComponents=Yes


This defaults to the normal network settings (Client for Microsoft Network, File and Printer Sharing, and TCP/IP (DHCP). Also within this section, you can add other protocols, clients, services, static IP, etc.

The only problem we experienced was when the PNP parameter is used with SysPrep, DNS settings will be wiped out because the NIC is re-detected. The only solution to this problem is using the section referenced below.

[GuiRunOnce]
Command0=C:\winnt\(DNS script or SMS package).


If you would like to run a script or any executable after login, you can enter it in this section. Our experience is that SysPrep breaks a couple key pieces to a basic image. One of those key pieces is DNS suffix entries, which can be easily reconfigured by using SMS Installer or some other packaging software. The other piece that gets overwritten is LanaCFG settings.

SysPrep Switches

/quiet - Prevents confirmation dialog boxes from being displayed to the user while Sysprep runs on the master computer. This is useful for the administrator who wants to automate Sysprep by adding it to the GuiRunOnce key of the Unattend.txt file.

/nosidgen – This switch notifies Sysprep not to generate new SIDs when the clone PC reboots. Remember that the disk cannot be duplicated if this switch is used. This is useful for the administrator who doesn't intend to clone the computer on which Sysprep is running or who wishes to preinstall domain controllers.

/reboot - Forces Sysprep to reboot the computer at completion instead of shutting down, and then start Mini-Setup. This is useful for auditing the system and verifying that Mini-Setup is operating correctly.

/noreboot - Prevents sysprep from shutting down after running.

/pnp - Forces a complete re-enumeration of all devices in the system. This will add about 2-5 minutes to the duration of the Mini-Setup Wizard, depending on the hardware involved. For Plug and Play devices, this switch is not required. This switch is only useful when ISA or other non-Plug and Play devices, that cannot be dynamically detected, exist on the target systems.

/forceshutdown - Forces the system to shutdown in the case where the system will not do so normally after running Sysprep.exe. This option is available only in Sysprep 1.1.

SysPrep Notes of Interest

  • Sysprep can be run on Windows 2000/XP Pro and Server, but not on Windows 2000 Domain Controllers.

  • Don't forget that Sysprep remunerates your hardware including network cards, video cards, sound cards, memory, and processor. Any setting static IP, DNS, WINS, or video settings will be reset to whatever you indicate in the sysprep.inf file. If nothing is indicated in the *.inf, the operating system will set everything to default.

  • Sysprep should not be used to prepare the operating system for imaging if the computer has software installed that is dependent on the computer's Security ID (SID). This is because the SID is removed by sysprep.

  • The size of the destination computer's hard disk must be at least the same size as the master or reference computer's hard disk. If the destination computer has a larger hard disk, the partition size on the destination hard disk will be the same as that of the master computer. However, you can use the ‘ExtendOemPartition’ in the Sysprep.inf file to extend the primary partition provided that it is formatted with the Windows NT file system (NTFS).

SysPrep.inf Example File

******************************************************************************

; December 2, 2002
; State Street – Kansas City
; Comments are preceded with a semi-colon
[SysprepMassStorage]
Primary_IDE_Channel = %windir%\inf\mshdc.inf
Secondary_IDE_Channel = %windir%\inf\mshdc.inf
PCMCIA\*PNP0600=%systemroot%\inf\mshdc.inf
*PNP0600=%systemroot%\inf\mshdc.inf
PCMCIA\KME-KXLC005-A99E=%systemroot%\inf\mshdc.inf
PCMCIA\_-NinjaATA--3768=%systemroot%\inf\mshdc.inf
PCMCIA\FUJITSU-IDE-PC_CARD-DDF2=%systemroot%\inf\mshdc.inf
*AZT0502=%systemroot%\inf\mshdc.inf
PCI\CC_0101=%systemroot%\inf\mshdc.inf
PCI\VEN_10B9&DEV_5215=%systemroot%\inf\mshdc.inf
PCI\VEN_10B9&DEV_5219=%systemroot%\inf\mshdc.inf
PCI\VEN_10B9&DEV_5229=%systemroot%\inf\mshdc.inf
PCI\VEN_1097&DEV_0038=%systemroot%\inf\mshdc.inf
PCI\VEN_1095&DEV_0640=%systemroot%\inf\mshdc.inf
PCI\VEN_1095&DEV_0646=%systemroot%\inf\mshdc.inf
PCI\VEN_0E11&DEV_AE33=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_1222=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_1230=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_7010=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_7111=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_2411=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_2421=%systemroot%\inf\mshdc.inf
PCI\VEN_8086&DEV_7199=%systemroot%\inf\mshdc.inf
PCI\VEN_1042&DEV_1000=%systemroot%\inf\mshdc.inf
PCI\VEN_1039&DEV_0601=%systemroot%\inf\mshdc.inf
PCI\VEN_1039&DEV_5513=%systemroot%\inf\mshdc.inf
PCI\VEN_10AD&DEV_0001=%systemroot%\inf\mshdc.inf
PCI\VEN_10AD&DEV_0150=%systemroot%\inf\mshdc.inf
PCI\VEN_105A&DEV_4D33=%systemroot%\inf\mshdc.inf
PCI\VEN_1106&DEV_0571=%systemroot%\inf\mshdc.inf

[Unattended]
;the following optional line means Setup won't pause for anything, including errors

UnattendedMode = FullUnattended
OemSkipEula = Yes
OemPreinstall=No

;this line tells Sysprep to look in these directories for Driver files not included with the OS setup files

OemPnPDriversPath = sysprep\Drivers\1\NIC;sysprep\Drivers\1\Sound\W2K;sysprep\Drivers\1\Sound;sysprep\Drivers\1\video;sysprep\Drivers\6\NIC;sysprep\Drivers\7\NIC;sysprep\Drivers\7\Video;sysprep\Drivers\8\NIC;sysprep\Drivers\8\Sound;sysprep\Drivers\8\Video;
sysprep\Drivers\Evo\3cOXNic;sysprep\Drivers\Evo\IntelNic;sysprep\Drivers\Evo\Nvidia;
sysprep\Drivers\Evo\Sound;sysprep\Drivers\Evo\Sound\Smaxwdm\W2k;
sysprep\VLi8\Keyboard;
sysprep\VLi8\NIC;sysprep\VLi8\Sound;sysprep\VLi8\Video

[GuiUnattended]
AdminPassword=*
OEMSkipRegional=1
TimeZone=20
OemSkipWelcome=1

[UserData]
FullName="YourCompanyName"
OrgName=" YourCompanyName"
ComputerName=MachineName
Productid = ProductIDgoeshere

;use this group to configure your graphics card

[Display]
ConfigureAtLogon = 0
BitsPerPel = 16
XResolution = 1024
YResolution = 768
VRefresh = 75
AutoConfirm = 1

[Identification]
JoinWorkgroup=WORKGROUP

[Networking]
InstallDefaultComponents=Yes
******************************************************************************

SysPrep became functional at our company thanks to Henry Duong. Henry can be reached via email at hmduong@statestreetkc.com.

  myITforum.com ©2010 | Legal | Privacy