#65194 - 2002-05-03 06:05 PM
Automating W2K Installation w/Sysprep & KiX
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Here is the documentation I promised that outlays how to use KiX to supplement and enhance Sysprep images. I put it here, as opposed to the FAQ so that people would feel free to comment and add their scripts/experiences to the knowledgebase.
quote:
Automating Windows 2000 Installations with Sysprep and KiXtart Across Varying Hardware Platforms
Why Sysprep? The process of deploying computers can be a lengthy process taking well more than an hour to install, setup, and customize a Windows 2000 installation. By using disk duplication (also called ‘cloning’) a standard configuration a deployment can take as little as 5-10 minutes per computer.
Cloning computers is fairly straightforward with using this process for identical or nearly identical hardware configurations. However, it is possible to use Sysprep and Windows 2000’s ability to identify plug-and-play hardware. I will discuss how to accomplish this later.
Adding KiX to the mix allows us to extend functionality to the unattended process. Using KiX one can automate virtually all of the tasks to ‘customize’ a user’s profile.
The downside to cloning is that you can only distribute the ‘image’ as a clean install; imaging won’t work for upgrades. Also, some applications installed on a standard configuration may not perform properly when imaging is used. Thus, planning, designing, and testing must be done.
Planning When planning for a Sysprep Image you should consider it a project. Projects have phases that are performed in order to ensure the success of the overall goal. There are five phases in any deployment of an image:
· Data gathering · Planning and design · Testing · Piloting · Production deployment
Data Gathering Before you plan and design your image, you need to understand the environment in which it will operate. Problems will arise if you don’t consider your environment. For this guide, we’ll focus on the last three of the following list.
At a minimum, assess and document the following:
· Business organization and geographical requirements · Network and application standards-both current and future · User types-who will be using the image? · Support processes · Naming conventions · Hardware configurations and standards · Application configurations and standards · User settings and user data
Analyze Hardware and Software Before you build an image you should have a clear understanding of the hardware and software deployed in your environment. For example, there may be some hardware restrictions that will affect how your image is deployed. Analyzing your software will help in understanding how users use software, potential compatibility issues, or licensing considerations.
Consider the target workstations Hardware Abstraction Layer (HAL). The types of mass storage, drive controllers, and number of processors will play an important role. Check your hardware against Microsoft’s hardware compatibility list at:
http://www.microsoft.com/windows2000/server/howtobuy/upgrading/compat/default.asp
Analyzing your software is important as it shows you what your users have installed, how they are using their computer, where their data is stored, and how the environment is managed.
Planning and Design Here is where we use the data we so fastidiously gathered and analyzed to plan and design our image. We will create the ‘master’ that when finished will be prepped for imaging with the Sysprep utility.
It is beyond the scope of this document to provide a complete reference for building a master image. Use your own experience, corporate guidelines, and best practices for setting up your Windows 2000 build. In general, the steps for creating your master will include:
· Installing Windows 2000 · Updating Device Drivers · Applying service packs, hotfixes, and updates · Setting up system and networking components · Installing utilities and software · Configuring desktop ‘look and feel.’ · Apply security policies · Install post-configuration tweaks · Etc.
Using your ‘master’ image across varying hardware platforms One of the more challenging aspects of designing a master image is getting it to work on computers that are dissimilar to the computer on which the master was built. If not done correctly you will find yourself staring blankly at a lovely blue-screen-of-death. We can overcome the majority of these limitations by utilizing the Sysprep utility.
Get the Sysprep 1.1 utility here:
http://www.microsoft.com/technet/treeview/default.asp?url =/TechNet/prodtechnol/windows2000serv/downloads/syprep11.asp
The Sysprep 1.1 download will include all the needed files, documentation, and some sample sysprep.inf files. I’d encourage you to become familiar with the documentation.
I won’t go into a lot of details on customizing the sysprep.inf file. See the documentation (Microsoft Windows 2000 Guide to Unattended Setup (unattend.doc)) for details. Essentially, you configure your customized sysprep.inf file to import your customized settings, run sysprep.bat with the appropriate switches to execute sysprep.exe, and make an image of the ‘prepped’ computer.
Suffice it to say, that using Sysprep you can do anything from displaying your company’s logo during setup to setting up user data information. I will display some examples of working around some of the more troubling issues.
The infamous “Stop 0x0000007B” error after cloning an image to a dissimilar PC Ok, here is the scenario; you’ve just created your master image (created on a Dell GX150), tweaked it out, run Sysprep, ‘imaged’ your master, and have successfully tested it on other Dell GX150’s. Great! Now you go to clone the image onto a Latitude C610 reboot and…blue screen of death.
Why? IDE chipsets. In order for Windows 2000 to boot, it has to be able to load the proper driver for the IDE controller. The IDE controller (and driver) for the GX150 is not the same as the C610.
Now what? It is possible to enable the controllers that natively supported by Windows 2000. Include the following section in your sysprep.inf file:
code:
[SysprepMassStorage] ;***********(Standard IDE ATA/ATAPI controllers)********* Primary_IDE_Channel=%windir%\inf\mshdc.inf Secondary_IDE_Channel=%windir%\inf\mshdc.inf
;*********** Generic_ESDI_Hard_Disk_Controller ********** *PNP0600=%windir%\inf\mshdc.inf
;*********** Aztech IDE Controller ********************** *AZT0502=%windir%\inf\mshdc.inf ;*********** Device ID for generic Dual PCI IDE ********* PCI\CC_0101=%windir%\inf\mshdc.inf
;************Acer Labs Inc ****************************** PCI\VEN_10B9&DEV_5215=%windir%\inf\mshdc.inf PCI\VEN_10B9&DEV_5219=%windir%\inf\mshdc.inf PCI\VEN_10B9&DEV_5229=%windir%\inf\mshdc.inf
;************Appian Technology ************************** PCI\VEN_1097&DEV_0038=%windir%\inf\mshdc.inf
;************CMD Technology ***************************** PCI\VEN_1095&DEV_0640=%windir%\inf\mshdc.inf PCI\VEN_1095&DEV_0646=%windir%\inf\mshdc.inf
;************Compaq ************************************* PCI\VEN_0E11&DEV_AE33=%windir%\inf\mshdc.inf
;*************Intel ************************************* PCI\VEN_8086&DEV_1222=%windir%\inf\mshdc.inf PCI\VEN_8086&DEV_1230=%windir%\inf\mshdc.inf PCI\VEN_8086&DEV_7010=%windir%\inf\mshdc.inf PCI\VEN_8086&DEV_7111=%windir%\inf\mshdc.inf PCI\VEN_8086&DEV_2411=%windir%\inf\mshdc.inf PCI\VEN_8086&DEV_2421=%windir%\inf\mshdc.inf PCI\VEN_8086&DEV_7199=%windir%\inf\mshdc.inf
;*************PC Technology ***************************** PCI\VEN_1042&DEV_1000=%windir%\inf\mshdc.inf
;*************Silicon Integrated System ***************** PCI\VEN_1039&DEV_0601=%windir%\inf\mshdc.inf PCI\VEN_1039&DEV_5513=%windir%\inf\mshdc.inf
;*************Symphony Labs ***************************** PCI\VEN_10AD&DEV_0001=%windir%\inf\mshdc.inf PCI\VEN_10AD&DEV_0150=%windir%\inf\mshdc.inf
;*************Promise Technology ************************ PCI\VEN_105A&DEV_4D33=%windir%\inf\mshdc.inf
;*************VIA Technologies, Inc. ******************** PCI\VEN_1106&DEV_0571=%windir%\inf\mshdc.inf
There are drivers for SCSI devices as well, and an example of the entries to use for SCSI devices are included in the Sysprep examples. I have not tested whether or not both IDE and SCSI entries can be used in the [SysprepMassStorage] section of the sysprep.inf. Feel free to experiment.
How to add Plug and Play drivers to the Windows 2000 installation Ok, using the same scenario as above. You’ve created your master on a GX150 and you’ve cloned the image to a C610. You managed to get the mass storage problem fixed, but now when you boot up the C610 plug and play kicks in and starts to install drivers for the ‘new hardware’ found. The problem is that the drivers for the new hardware aren’t included with the image.
How do we add the third-party drivers to the Windows 2000 installation, you ask? Use the following procedure to add your OEM-supplied drivers:
quote:
1. On the root of the volume where the %windir% folder is located, create a folder structure to hold the OEM-supplied drivers. For example:
code:
C:\Drivers .....\NIC .....\VIDEO .....\SOUND .....\ETC.
2. Copy the OEM-supplied drivers to their appropriate sub-folders. 3. Add the OemPnPDriversPath entry in the [Unattended] section of the Sysprep.inf file. You can list multiple paths in this key by separating them with a semicolon, as shown in the following example:
code:
[Unattended] OemPnPDriversPath = Drivers\NIC;Drivers\Video;Drivers\Sound;Drivers\ETC.
Note: The %SystemDrive% environment variable is automatically inserted before each of the listed search paths.
If you do not want the OEM-supplied drivers to remain on the HDD after the mini-wizard is finished, you can place the folder structure you created under the Sysprep folder. You will need to adjust the OemPnPDriversPath appropriately. The Sysprep folder (along with its sub-folders are automatically removed after Setup is finished.
Save the Sysprep.ini file in the Sysprep folder and run the Sysprep.bat. Any Plug and Play devices (including the ones you added) are automatically installed during the mini-setup wizard on the target computers. Note that you will not need to specify the –pnp command line switch in your Sysprep.bat file unless there are legacy (ISA) devices on the target computers. Using the –pnp switch will force a full Plug and Play re-enumeration of all devices. This will add 5-10 minutes to the Setup mini-setup process.
Note: If the OEM-supplied drivers are unsigned, the mini-setup postpones the installation of the device until an administrator logs on to the computer. See the following ‘Q’ articles in Microsoft’s Knowledge Base for more information:
Q236029 Setting Driver Signing Policy for Windows 2000 Unattended Setup Q256204 Unsigned Drivers Not Installed During Sysprep Mini-Wizard Without –pnp Switch
Incorporating KiXtart with Sysprep The Sysprep process includes several techniques for added customization. However, there are limitations with these options; for example, installing and configuring a sound card or installing a service.
Follow these steps to include a KiX script during the mini-setup:
quote:
1. Copy KiXtart (and any other utility you use to administer computers) to the appropriate locations. Also, register any DLL that needs registered (i.e. KixGUI, AutoItX, etc.) 2. Create a file name Cmdlines.txt with the command-line information to run your script at the top of the file. Example:
[Command] ”C:\Sysprep\i386\$oem\kix32 kix_prep.kix”
3. Copy the script to the proper location in your Sysprep folder.
The included script will run at the very end of the mini-setup wizard process. Here is a sample script:
Kix_prep.kix:
code:
$model=WMIQuery("Model","Win32_ComputerSystem") $model=rtrim($model) Select Case $model="OptiPlex GX150" goto "GX150_Drivers" Case $model="Latitude C610" goto "C610_Drivers" EndSelect
? "Your model of computer ($model) is not directly supported by this image." exit
:GX150_Drivers ; copy your drivers here, remember that the Sysprep folder will be deleted when done. goto "Next"
:C610_Drivers ; copy your drivers here, remember that the Sysprep folder will be deleted when done. goto "Next"
:Next ; do other stuff here. Like...set a runonce key to run another script during the ; Autologon section you set up in your sysprep.inf file. ? "KiXPrep finished..." exit
FUNCTION WMIQuery($what,$where,) dim $strQuery, $objEnumerator, $value $strQuery = "Select $what From $where" $SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//@WKSTA") $objEnumerator = $SystemSet.ExecQuery($strQuery) For Each $objInstance in $objEnumerator If @Error = 0 and $objInstance <> "" $=execute("$$value = $$objInstance.$what") $WMIQuery="$value"+"|"+"$WMIQuery" EndIf Next $WMIQuery=left($WMIQuery,len($WMIQuery)-1) exit @error ENDFUNCTION
Follow these steps to run a KiX script as a post-setup script:
quote: 1. Setup your Sysprep.inf file to Autologon as administrator. Example:
code:
[GUIUnattended] Adminpassword=password Autologon=Yes Autologoncount=1
2. Use the steps outlined above to create a Cmdlines.txt file. 3. Include in your KiX script the code to write into the Runonce key of the registry. Example (extended from above):
quote: :Next $=writevalue(“hkey_local_machine\software\Microsoft\windows\runonce”,”Kix_Post”,”kix32 %temp%\kix_post.kix”,”reg_sz” exit
4. Copy your ‘Post Setup’ script to the appropriate directory.
Now you have created a method for running a script that will run after the mini-setup has rebooted your computer. Use your “Post Setup” script to automate tasks that cannot be accomplished by Sysprep like; installing machine specific drivers or software (i.e. touchpad drivers, chipset installations, changing computer name, add workstation to the domain, etc.). Use your imagination.
Testing, Piloting, and Deployment Use the Testing and Piloting phases of your ‘Sysprep Image’ project to work out bugs and gain end-user acceptance. When that is done, you can begin Deployment.
[ 04 May 2002, 01:17: Message edited by: Chris S. ]
|
Top
|
|
|
|
#65196 - 2002-05-03 08:12 PM
Re: Automating W2K Installation w/Sysprep & KiX
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I'd like to second Les.. there a good about of work in this. Writing up the document not to mention collecting the data and research that went into it.
We have many sysprepped images for a variety of machines (compaq deskpro 400 - 1.7g) and dell latitudes (300 - 1.1g) which require about 10 different images due to chipsets, storage controllers, video/sound controllers, etc.
If this procedure can modify our image creation process to reduce the number of images (even by half) this would be a great benefit to us.
|
Top
|
|
|
|
#65197 - 2002-05-03 08:20 PM
Re: Automating W2K Installation w/Sysprep & KiX
|
Chris S.
MM club member
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Using this method is the 'real' lazy approach to imaging. Once you have it set up and working it is real easy to add new computers to the image. Now, when I make a change to our 'standard' deployment it is automatically reflected on all computers.
I came up with this method over the course of about two months of research and testing. The document I wrote above took about 10-12 hours to write (I looked busy, so I don't think my boss noticed. ).
When I made my original image I used a combination of batch files, a Wise script, and Autoit to accomplish my goals. I'm thinking of re-writing everything in KiX. As I do this, I'll post more sample scripts.
|
Top
|
|
|
|
#65198 - 2002-05-04 12:10 AM
Re: Automating W2K Installation w/Sysprep & KiX
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I think this is good work. I agree 100% with Radimus and Les.
However, the format of this posting is annoying to read. I found myself dragging the screen all over the place to read.
Thanks!
- Kent
|
Top
|
|
|
|
#65201 - 2002-05-04 01:55 AM
Re: Automating W2K Installation w/Sysprep & KiX
|
Les
KiX Master
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
Kent and others, You mentioned dragging the window side to side... Not really necessary. If you look down at the bottom you will see a link to "Printer-friendly view of this topic" which is more than just "printer" friendly. It will make all lines wrap at the edge of the (screen) page. No need to side-ways schroll!
Lonkero, You don't know what you're missing. I can have a build dropped down to a user in 15, 20 minutes tops. Like Chris said, complete with service packs, hot fixes, applications, customizations, everything. I just couldn't see myself building every machine from scratch. And when a user messes up their build, in 20 minutes there "as good as new".
About the only thing I build from scratch are the odd new image for a special application or hardware, and of course, my servers. I do make images of servers from time to time but only as a backup prior to a risky upgrade. These would not be SysPrep'd.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.
|
Top
|
|
|
|
#65205 - 2002-05-05 09:06 AM
Re: Automating W2K Installation w/Sysprep & KiX
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
If you want to REALLY automate the process, you should try looking at ALTIRIS.
Very powerful automation. Can even schedule periodic "sysdiff" type images of the user's computer so that even the user can repair, replace his/her image without your assistance. They also have PC Transplant Pro which is a very powerful utility that allows you to save almost every personal file and setting and apply it to a new computer. i.e. You could convert a user from Windows 95 to 2000 or XP and aside from the logon screen they would hardly even know their computer was switched out.
In my opinion there is no other company that has as complete a solution as they do. They have their bugs and issues I'm sure, just as every other product out there does, but I also feel it is the best one out there period.
If you can, have someone come out and to an in-house demo, I've been to their SMS/Altiris seminar in Las Vegas, and what this system can do is simply amazing. Supports the PXE boot and imaging as Lonkero is talking about, but so much more. We use Ghost 7.5, but that is only a small picture of what Altiris can do.
Heck, if I ever lost my current job, I wouldn't mind working for them, and working with that type of technology on a day-to-day basis.
|
Top
|
|
|
|
#65212 - 2003-04-28 09:48 PM
Re: Automating W2K Installation w/Sysprep & KiX
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Hey Chris, I have a problem with a sysprepped machine
Evo 510 image to latitude c540
It hangs on the black progress bar, just prior to the mini-setup starting.
Any ideas??
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 262 anonymous users online.
|
|
|