Using Sysprep in Boot Camp

Intro to Sysprep
Sysprep (or system preperation tool) is a tool from Microsoft that helps deploy large-scale Windows computers with minimal administrator interactivity. Once you “Reseal” the computer with the sysprep computer, the next time the computer boots, it runs sysprep and configures the computer. It can be used to do a wide variety of things, but for the purpose of this article, I will be focusing on a general perspective, with applications to Boot Camp. There is a lot of documentation online for you too read through. Some from Microsoft, wiki’s, or forums. So if you need more information, they are good places to start. I suppose the first thing you going to need is the sysprep utility itself, which can be downloaded here.

Configuring Sysprep
The configuration of sysprep is all contained in one file in the sysprep folder, called “sysprep.inf”. This is a simple text file that tells sysprep what to do (or not do) when being run during the first boot of a freshly imaged computer, and yes it can be edited with TextEdit or Notepad. Here is what a final sysprep.inf file looks like.

;SetupMgrTag
[Unattended]
OemSkipEula=Yes
InstallFilesPath=C:\sysprep\i386
UpdateInstalledDrivers=yes
OemPnPDriversPath = "appledrivers"
DriverSigningPolicy=ignore

[GuiUnattended]
AdminPassword=”adminpassword”
EncryptedAdminPassword=NO
OEMSkipRegional=1
TimeZone=35
OemSkipWelcome=1

[UserData]
ProductKey=XXXXX-XXXXX-XXXXX-XXXX
FullName="any name you want, maybe department?"
OrgName="company name"
ComputerName=*

[Identification]
JoinDomain=ad.bind.domain
DomainAdmin=bindname
DomainAdminPassword=bindpassword

[Networking]
InstallDefaultComponents=Yes

[Display]
BitsPerPel=32
Xresolution=1440
YResolution=900
Vrefresh=60

[Branding]
BrandIEUsingUnattended=Yes

[GuiRunOnce]
c:\windows\myBatFile.bat

[sysprepcleanup]


As you can see, its not too complicated, you can pretty much read it and understand what is going on. You can create this file using a text editor, or use the “setupmgr.exe” included in the sysprep folder that is a simple wizard. This is great for getting started, but it is not an end all of be all. Chances are, you will have to do some editing by hand. Let me break down this sysprep.inf file to better understand it.

OemSkipEula=Yes
This is so you are not prompted to the Microsoft End User License Agreement when you first boot up the machine. Chances are you will want to skip it.

UpdateInstalledDrivers=yes
This tells sysprep to update the drivers it has associated with its hardware. This can be used to use one Boot Camp image for several different Mac models.

OemPnPDriversPath = "appledrivers"
This is telling sysprep where it can find the drivers to update the hardware from the previous command. It assumes you are starting in the c:\ or root folder.

DriverSigningPolicy=ignore

This is suggested, because when updating the drivers, Windows may try to assigned an unsigned driver which will prompt you asking if its ok.

EncryptedAdminPassword=NO
I recommend that you do not encrypt the password. I find it causes more issues that it solves, but its up to you.

ComputerName=*
With the computer name as “*”, sysprep will generate a random computer name. This is important as it gives each computer its own unique name.

[Identification]
This section can be used to bind to an Active Directory domain as shown in the example. It can also be used to join a workgroup by writing in “JoinWorkgroup=WORKGROUP”

[Display]
The display section is where you can set the resolution. This is optional

[GuiRunOnce]
The last part tells sysprep to run this or these files. They only run once, and run after the first user logs in. This is a very important for this article, as you will see later on. Do not place a bat file that you want to run inside of your sysprep folder and try to run it from there. By the time the bat file is run, sysprep would have already deleted the sysprep folder.