Automatically Apply Regional Settings by IP

Here at the company I work for, we have a number of offices scattered around the world. Computers imaged at each office have to be placed in an OU specific to each office, have an office-specific Local Admin password set, and have the timezone set. Originally, we had a separate Task Sequence for each office, and we’d have to pick the right one. Unfortunately, this also meant that we had at least 5 of each Task Sequence, which made updating software packages pretty tedious, as we’d then have to update them in each TS.

I didn’t want to create an HTA to have the local IT guy manually select an office, and I was also averse to having the local IT guy enter specific values in the form of a Task Sequence Variable. Our offices each have well-defined subnets, so I knew there’d have to be a way to have the task sequence automatically apply these regional settings based on the IP address. Here’s how to do it (note: these instructions are for SCCM 2007; I’m not sure how they’d need to be modified for SCCM 2012 at this time):

  1. Start by closing out of the Configuration Manager Console on the Site Server
  2. Download Microsoft Deployment Tools (MDT) 2012 and install on the Site Server.
  3. After installing, go to Start > All Programs > Microsoft Deployment Toolkit > Configure ConfigMgr Integration.
  4. You’ll want to select the radio button for Install the MDT extensions for Configuration Manager, and check the boxes for Install the MDT console extensions for ConfigMgr 2007 and Add the MDT task sequence actions to a ConfigMgr server:
  5. Next, re-launch the Configuration Manager Console and create a new package (I just called mine “MDT”). You’ll want to set the source to the location of the “Templates\Distribution” folder within your MDT installation (using the UNC path). For me, that was “\\[SiteServer]\c$\Program Files\Microsoft Deployment Toolkit\Templates\Distribution”.
  6. Distribute this package (no need to create any programs here) to your Distribution Points as normal.
  7. Open up the Task Sequence you want to modify. I created a new group within this TS and called it “Regional Settings,” and put all the following steps within that group just for organization.
  8. In the Task Sequence Editor, select AddMDTUse Toolkit Package. Click on this step and add your Toolkit Package by clicking the Browse button and locating your MDT package.
  9. Add another step: AddMDTGather, and specify for that step to Gather only local data (do not process rules).
  10. Now, let’s create a group for each region/office. Each group should contain the Apply Windows Settings and Apply Network Settings steps, with Local Admin password, Time Zone, and OU set accordingly (and any other region-specific settings; I’m working on having the task sequence install a Language Pack for our German office as well, but haven’t gotten that far yet). I also included a Set Task Sequence Variable step called “Set Location Variable” in which I create a TS Variable called “OSDLocation” and assign a specific two-letter code, because I’ll probably eventually start assigning specific software titles to specific offices as well.
  11. For each group, click the Options tab and click Add Condition. First, we’ll add an If Statement, to run if Any conditions are true.
  12. Under that If Any statement, click Add Task Sequence Variable. The Variable we’re going to be looking at is called DefaultGateway001, and we’ll want to set it to equal whatever this office’s Default Gateway is. Some of our offices have multiple possible Default Gateways, so you’ll just want to set this for any possible Default Gateway in each office.
  13. Test your Task Sequence! It should image successfully, and show up in the correct OU, with the right Time Zone and Local Admin password.

You’re all set! If you have any trouble with any part of this, please leave a comment below!

2 thoughts on “Automatically Apply Regional Settings by IP

  1. Loic sarraillon


    I have created a task sequence with similar configuration as I want that the workstation been moved to the right OU too depending on gatewa IP address, all this works perfectly.

    For some reason, even if I have correctly configured the variable InputLocale,UI and other parameters to en-GB it doesn’t change the keyboard input but remains in american.

    By looking in the smsts.log file, I found these values were correctly gathered but I am still in US keyboard.

    Would you have any idea which file should I look next to see what’s happening?

    Obviously, I am using MDT as your instruction but not using customesettings.ini or unatended.xml

    Thanks in advance for your help, I am having some serious deadline to start deployin windows 7 to new hardware.

    This is only happening for bare metal deployment but not in upgrade or refresh scenario and this is because the task sequence captures the user settings at the beginning then restore them at the end. The problem being that if a new user login I would be in US too for keyboard as well as the other regional settings

Leave a Reply

Your email address will not be published. Required fields are marked *

Please do some math to prove you\'re a human: * Time limit is exhausted. Please reload the CAPTCHA.