Dynamically Set TimeZone During OSD From DP
Create a task sequence step which could be optionally added to dynamically set the time zone on a client during OSD based upon the time zone of the distribution point said client is retrieving content from.

5 comments
-
Abdul commented
Hi Tariq I know its been 2 years since you asked for the WQL query but its as follow:
SELECT * FROM Win32_NTDomain where DCSiteName LIKE "SITENAME"
First I got all the names of the sites by running the following PS Script:
$DomainName = (Get-ADDomain).DNSRoot
Get-ADDomainController -Filter {enabled -eq $true} -Server $DomainName | Select-Object Hostname,Ipv4address,site,operatingsystem
I apply the condition as WMI at 'Apply Windows Settings' Step I have created copies of it for each site.
'Apply Network Settings' is the step above it as that joins the machine to the Domain then you can query the DC Site name.
-
Tariq commented
You can set a dynamic variables task and create a condition based on the default gateway.
-
Tariq commented
Hi Wade,
Can you please share your WMI query here, if possible.
Thanks
-
Wade Atkinson commented
We do something similar, but leverage AD Sites. We run WMI Queries after the machine has joined the domain to determine what site its in, if the site is say %MO% for Missouri then we would run the tzutil to change the timezone to CST.
-
Matthew Gailer commented
I've actually achieved this using Dynamic Variables within the Task Sequence, where there were DP's all across the country that were capable of performing OSD builds. You can then use the "tzutil" command as "Run Command Line" with the variable e.g. tzutil /s %TZone%. Works like a charm.