Using Task Sequence Variables to customize deployments
*******************************************************
This Blog has moved to http://ronnipedersen.com/ !!!
*******************************************************
Living in a non-english speaking country like Denmark, I often have to deal with deploying English versions of Windows XP and/or Windows Vista, with other Regional Settings, Keyboard Settings, Time Zones etc.
In the past I've created a VBScript to modify the sysprep.inf or the unattend.xml, after laying down the image on the client. The values were configured with Collection Variables or Computer Variables. The script collected the value during deployment, and replaced the value in the sysprep.inf or unattend.xml file before restarting into mini setup.
This year at TechEd in Orlando, I attened a great session on Windows Deployment with Configuration Manager (Part 1 of 4) with Michael Kelly. In this session he showed a demo, where he created a custom variable ("XRes" and "YRes"), and typed the variable direct in sysprep.inf like this:
sysprep.inf:
[Display]
XResolution=%XRes%
YResolution=%YRes%
This was a simple example, but it gave me a lot of ideas to work with. And as a result of this, I no longer need my "fancy" script to take care of my deployments anymore. This is how I do it now (example):
For my Windows XP deployments I've created a sysprep.inf that looks like this:
(This can also be done with Windows Vista deployments, but you’ll need to use the unattend.xml and the format should be in XML).
sysprep.inf:
[GuiUnattend]
TimeZone=%LAB_OSDTimeZone%
[ResionalSettings]
SystemLocale=%LAB_OSDSystemLocale%
SystemInput=%LAB_OSDSystemInput%
[Display]
XResolution=%LAB_OSDXResolution%
YResolution=%LAB_OSDYResolution%
The sysprep.inf file should be place in a package in order to use it from the task sequence.
In the “Deploy Windows XP” Task Sequence, you need to specify the sysprep.inf file in the “Apply Operating System” section, like this:
![clip_image002[7] clip_image002[7]](http://myitforum.com/cs2/blogs/rpedersen/WindowsLiveWriter/UsingTaskSequenceVariablestocustomizedep_A1C4/clip_image002%5B7%5D_thumb.jpg)
In order to use the sysprep.inf containing the variables we need to assign some variables to our collection first.
How to Create Collection Task Sequence Variables:
 |
In the Configuration Manager console, System Center Configuration Manager / Site Database / Computer Management / Collections. |
|
To assign a variable to a collection, right-click the collection, and then click Modify Collection Settings. |
|
Open the <New> Variable dialog box, click the Collection Variable tab, and then click the New icon. |
|
In the New Variable dialog box, specify a name (example: “LAB_OSDSystemInput”) for the variable.
On the Value line, specify the Value (Example: 0406:00000406 for danish keyboard) of the variable, and if the value is masked, enter the value again to confirm the variable on the Confirm Value line, and then click OK. |
| |
You can also specify Precedence by selecting a numeric value from the drop-down list, where 1 is the lowest precedence, and 9 to specify the highest precedence. The Precedence level will be used when a computer is a member of multiple collections with differing precedence levels assigned. |
| |
You can also specify per-computer task sequence variables, by right-clicking the computer object, click Properties, and then click the Variables tab.
Per-computer variables will allways overwrithe per-collection variables. |
That’s all folks… No more scripting for modifying the sysprep.inf file during deployment :-)
Additional resources:
TimeZone codes: (scroll down to the end where you’ll find “TimeZone”)
http://technet2.microsoft.com/windowsserver/en/library/1cd05ce1-7eaa-4b03-bef5-772bb2d799eb1033.mspx?mfr=true
Locale ID’s and Input Locale:
http://www.microsoft.com/globaldev/reference/winxp/xp-lcid.mspx
*******************************************************
This Blog has moved to http://ronnipedersen.com/ !!!
*******************************************************