OSD – Customising deployment depending on location

It’s been a while since I posted anything, but I’ve been really busy at home and in work.

Although I have beening using OSD for a while it hasn’t been completely automated, things like timezone, keyboard locale etc still need to be changed by an administrator after a rebuild. Now we have sites in America, UK, Europe and Japan, so I need to account for them in my task sequence. I will admit here that I had a bit of trouble with getting the script to work so I did get some help from MS (they added 2 lines of code to the script and 1 task sequence event).

There are 2 parts to this, 1st is the vbscript to detect and set the location and then some task sequence events to act on the variables we set.

The vbs script:

  • [Download not found]
  • [Download not found]
  • [Download not found]

Note: The getSite_WMI script was the original script I wrote and is inefficent and not pretty but does work. The next two scripts are improvements on it which I haven’t test yet but should work fine. the getSite_Gateway imo is the best as it is the simplest to maintain.

Task Sequence:

  1. Edit your task sequence
  2. Select Preinstall -> Add New Group “Get-Set Custom Variables”
  3. Select “Get-Set Custom Variables” -> Add Set Task Sequence Variable
    1. Name: Set Current Site
    2. Task Sequence Variable: “SiteAddress”
    3. Value: “Null”
  4. Select “Set Current Site” -> Add Run Command Line
    1. Name: Get Site
    2. Command Line: cscript.exe. %deployroot%\scripts\<SCRIPT>
      Replace <SCRIPT> with “getSite_WMI.wsf” or “getSite_IP.wsf” or “getSite_Gateway.wsf” depending on the script you downloaded.
    3. Value: “Null”
  5. Under “PostInstall” select Gather -> Add New Group “Site Specific Settings”
  6. Select “Site Specific Settings” -> Add New Group “Site1”
    1. Select “Site1” -> options
    2. tick continue on error
    3. Add condition -> IF statement -> ALL
    4. Add condition -> Task Sequence Variable -> SiteAddress = “site1”
  7. Select “Site1” -> Apply Windows Settings
    1. Fill in as applicable for site1
  8. Select “Site1” -> Apply Network Settings
    1. Fill in as applicable for site1
  9. Repeat 6,7,8 as needed per site
  10. Select “Site Specific Settings” -> Add New Group “Defaults”
    1. Select “Site1” -> options
    2. tick continue on error
    3. Add condition -> IF statement -> ALL
    4. Add condition -> Task Sequence Variable -> SiteAddress not equals “site1”
    5. Add condition -> Task Sequence Variable -> SiteAddress not equals “site2”

One thought on “OSD – Customising deployment depending on location

  1. I had a similar scenario with MDT2010 to set locale, timezone, and OU membership. I created locations in MDT, and gave the instruction that if the pc being built is in this location, it goes in xyz OU. Basically all MDT does is ask the nic card what it’s default gateway is, since 9 times out of 10 that is site specific. Then i set the locale, timezone, etc for that location. No more annoying little admin steps after an image deployment.

    I know that you posted this for SCCM, but MDT has some similar features, might help someone looking for answers.
    theDude

Leave a Reply

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