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:

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\

      This blog is kept spam free by WP-SpamFree.