Using Task Sequence Variables to customize deployments

5

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]

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:

clip_image002
In the Configuration Manager console, System Center Configuration Manager / Site Database / Computer Management / Collections.

image
To assign a variable to a collection, right-click the collection, and then click Modify Collection Settings.

image

Open the <New> Variable dialog box, click the Collection Variable tab, and then click the New icon.

image
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

About Author

My name is Ronni Pedersen and I'm currently working as a Cloud Architect at APENTO in Denmark. My primary focus is Enterprise Client Management solutions, based on technologies like AzureAD, Intune, EMS and System Center Configuration Manager. I'm is also a Microsoft Certified Trainer and Microsoft MVP in Enterprise Mobility.

5 Comments

  1. Hey,
    Thanks for a nice blog article. But how about if we would like to have different regional settings to our sales offices? Any good idea how that could work?

  2. How about if we have different sales offices with different regional settings? is there any easy solution to do that?

  3. Hi Zy,

    You could create collections for each sales office with regional settings for each office, but if you want a more “dynamic” method, you should use the Microsoft Deployment Toolkit.
    Then you can specify regional settings based on the default gateway (and you get a nice GUI for it) 🙂

  4. Ian Broadbent on

    Hi Ronni, thanks for your article.
    To just set the timezone, I use a Task Sequence step that uns a VBscript to determine the Active Directory site code:
    ———–
    ‘get ClientSiteName & set OSD Task Seq. variable – Ian Broadbent

    On Error Resume Next
    Dim objService, objSMSEnv, strSite, wmiLocator

    set wmiLocator = CreateObject (“WbemScripting.SWbemLocator”)
    set objService = getobject(“winmgmts:”).ExecQuery(“Select ClientSiteName From Win32_NTDomain”)
    For Each objInstance in objService
    if objInstance.ClientSiteName “” then
    strSite = objInstance.ClientSiteName
    end if
    Next

    ‘ Set the TS Environment Variable
    Set objSMSEnv = CreateObject(“Microsoft.SMS.TSEnvironment”)
    objSMSEnv(“OSDDOMAINSITE”) = strSite
    ———–

    Then I use the OSDDOMAINSITE variable to set the appropriate timezone in another TS step. e.g. if the variable is WESTAUST, I run this command (for WinXP)
    CONTROL.EXE TIMEDATE.CPL,,/Z W. Australia Standard Time

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.