Freigeben über


Setting MDT Time Zone Variables from the Source OS Time Zone

15 Feb 2010 Update – To use technique found in this post with MDT 2010 you will need to use one of the workarounds described in this post:  https://blogs.technet.com/deploymentguys/archive/2010/02/15/using-convertbooleantostring-with-ztigather-wsf-in-mdt-2010.aspx.

System Center Configuration Manager 2007 Operating System Deployment has the ability to migrate the time zone from the source operating system to the destination operating system.  This is done by using the Migrate time zone option in the Capture Windows Settings step of the task sequence.

Unfortunately, MDT Lite Touch Deployment does not offer the same functionality.  So I created a User Exit script (GetCurrentTimeZoneExit.vbs) to query the source OS time zone and set the MDT time zone variable(s).  Using this script with the CustomSettings.ini entries below will always set TimeZoneName and on legacy operating systems (Windows XP/Windows Server 2003 and earlier) it will set TimeZone.  Also, the script can set two custom variables that query WMI for the time zone standard name (TimeZoneStandardName) and the Control Panel description of the time zone (TimeZoneCaption).

Copy GetCurrentTimeZoneExit.vbs to the MDT Scripts folder and add the following entries to CustomSettings.ini:

[Settings]
Priority=TimeZone, TestLegacyOS
Properties=TimeZoneStandardName, TimeZoneCaption, IsLegacyOS

[TimeZone]
UserExit=GetCurrentTimeZoneExit.vbs
TimeZoneStandardName=#GetCurrentTimeZoneWmiProperty("StandardName")#
TimeZoneCaption=#GetCurrentTimeZoneWmiProperty("Caption")#
TimeZoneName=#GetCurrentTimeZoneRegistryKeyName#
IsLegacyOS=#ConvertBooleanToString(%OSCurrentBuild% < 5200)#

[TestLegacyOS]
SubSection=IsLegacyOS-%IsLegacyOS%

[IsLegacyOS-True]
TimeZone=#GetCurrentTimeZoneLegacyIndex#

 

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .

This post was contributed by Michael Murgolo, a Senior Consultant with Microsoft Services - U.S. East Region.

GetCurrentTimeZoneExit.zip

Comments

  • Anonymous
    February 03, 2011
    The comment has been removed