Close Menu
    Facebook X (Twitter) Instagram
    Trending
    • Workplace Ninja User Group Denmark – April 2026 Meetup
    • Workplace Ninja User Group Denmark March 2026 Meetup
    • Workplace Ninja User Group Denmark February 2026 Meetup
    • Successful Adoption of a “Cloud First” Strategy
    • Speaking at Nordic Virtual Summit
    • Workplace Ninja User Group Denmark February Meetup
    • Workplace Ninja User Group Denmark Meetup – May 2022
    • Workplace Ninja User Group Denmark Meetup – April 2022
    RONNIPEDERSEN.COM
    • Home
    • Enterprise Mobility
      • Configuration Manager
      • Identity and Access
      • Information Protection
      • Intune
    • Cloud and Data Center
      • Data Center Management
      • Group Policy
      • Enterprise Security
      • Hyper-V
      • PowerShell
    • Guides
    • Webcasts
    • Links
    • About
      • Contact me
      • Disclaimer
    RONNIPEDERSEN.COM
    You are at:Home»Uncategorized»Using Task Sequence Variables to customize deployments

    Using Task Sequence Variables to customize deployments

    5
    By Ronni Pedersen on July 1, 2008 Uncategorized

    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

    • Tweet
    • Share 0
    • +1
    • LinkedIn 0

    Related

    Ronni Pedersen
    • Website
    • Facebook
    • X (Twitter)
    • LinkedIn

    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.

    Related Posts

    Successful Adoption of a “Cloud First” Strategy

    Workplace Ninja User Group Denmark Meetup – May 2022

    Managing Extended Security Updates for Windows 7 using Microsoft Endpoint Manager

    5 Comments

    1. Rafal on October 26, 2010 12:07

      Should it not be RegionalSettings instead of ResionalSettings 🙂 ?

      Reply
    2. Zy on October 17, 2011 15:35

      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?

      Reply
    3. Zy on October 17, 2011 16:58

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

      Reply
    4. Ronni Pedersen on October 18, 2011 12:10

      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) 🙂

      Reply
    5. Ian Broadbent on January 2, 2013 23:49

      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

      Reply
    Leave A Reply Cancel Reply

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

    Follow
    APENTO

    Follow APENTO here:

    Subscribe to Blog via Email

    Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    About
    My name i s Ronni Pedersen and I'm currently working as a Cloud Architect at APENTO in Denmark. My primary focus is Endpoint Management and Security, based on Microsoft technologies. I'm also a Microsoft Certified Trainer and a dual Microsoft MVP in both Security and Windows.
    Recent Posts
    • Workplace Ninja User Group Denmark – April 2026 Meetup
    • Workplace Ninja User Group Denmark March 2026 Meetup
    • Workplace Ninja User Group Denmark February 2026 Meetup
    • Successful Adoption of a “Cloud First” Strategy
    • Speaking at Nordic Virtual Summit
    Archives
    TOP POSTS
    • Azure AD: Authentication Administrator Role is now available
    • System Center Essentials 2007 Operations Guide
    • How to Access the MBAM BitLocker Recover Keys directly in SQL
    • Microsoft Office Visio 2007 Pro SCOM & SCCM Connectors
    • System Center Configuration Manager 2007 SP2 ready for download
    RECENT COMMENTS
    • cOSHi on Missing “UserType” attribute in Azure AD
    • Gus on Pro Tip: Use Ctrl+Alt+D from the Azure Portal to get performance information
    • Sebi on Prepare for Co-Management: Migrate Intune Devices without user affinity
    • Vadim P on SCCM: Failed to Get Client Identity (80004005)
    • TM on Active Directory Based Activation in an multi domain environment
    DISCLAIMER
    The content on this website is presented "as-is" with no guarantees. The use of scripts from this website is at your own risk. Always test before putting something in production! Opinions expressed are my own.
    © 2026 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.