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 id=”23″]
- [download id=”24″]
- [download id=”25″]
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.
- Edit your task sequence
- Select Preinstall -> Add New Group “Get-Set Custom Variables”
- Select “Get-Set Custom Variables” -> Add Set Task Sequence Variable
- Name: Set Current Site
- Task Sequence Variable: “SiteAddress”
- Value: “Null”
- Select “Set Current Site” -> Add Run Command Line
- Name: Get Site
- Command Line: cscript.exe. %deployroot%\scripts\
This blog is kept spam free by WP-SpamFree.