Home » Eastern Daylight savings time is changing

Google
 

Eastern Daylight savings time is changing

So the US and Canada have agreed to extend the daylight savings time by roughly 2 months. This of course makes the life of a sysadmin (regardless of OS type) painfully as all systems need to be updated with relevant patches. Good ole Microsoft has put out a there usual verbose article on how to update systems:

http://support.microsoft.com/kb/914387



Since there are some manual steps to the process I decide to use my developing scriptings skill to whip up a life saver. In order to use this script you must make the manual changes outlined in the article and extract the relevant registry keys to be applied to all the other guinea pigs that you manage. Please use this at your own risk…..like everthing elese you find on the Web :-):

———————————————————

‘ Step 1. Execute time zone change reg file

Dim objshell
Const conSuccess = 0

Set objshell = CreateObject(”wscript.shell”)

objshell.Run “regedit /S timezonechange.reg”,0,True

‘ Step 2. Execute time zone information reg file

objshell.Run “regedit /S timezoneinfo.reg”,0,True

‘ Step 3. Apply time zone (GMT-08:00) Pacific Time

On Error Resume Next

strComputer = “.”
‘Change value to reflect desired GMT offset in minutes.
intGMTOffset = -480

Set objWMIService = GetObject(”WinMgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″)

Set colCompSys = objWMIService.ExecQuery _
(”Select * from Win32_ComputerSystem”)

For Each objCompSys in colCompSys
objCompSys.CurrentTimeZone = intGMTOffset
objCompSys.Put_
If Err = 0 Then
Wscript.Echo “Time zone set to PST.”
Else
Wscript.Echo “Unable to set time zone.”
End If
Err.Clear
Next

‘ Step 4. Apply time zone (GMT-05:00) Eastern Standard Time to effect regsitry changes.

On Error Resume Next

strComputer = “.”
‘Change value to reflect desired GMT offset in minutes.
intGMTOffset = -300

Set objWMIService = GetObject(”winmgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″)

Set colCompSys = objWMIService.ExecQuery _
(”Select * from Win32_ComputerSystem”)

For Each objCompSys in colCompSys
objCompSys.CurrentTimeZone = intGMTOffset
objCompSys.Put_
If Err = 0 Then
Wscript.Echo “Time zone set to EST.”
Else
Wscript.Echo “Unable to set time zone.”
End If
Err.Clear
Next

‘ Step 5. Display current settings

On Error Resume Next

strComputer = “.”
Set objWMIService = GetObject(”winmgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″)

Set colItems = objWMIService.ExecQuery(”Select * from Win32_TimeZone”)

For Each objItem in colItems
Wscript.Echo “Bias: ” & objItem.Bias
Wscript.Echo “Standard Name: ” & objItem.StandardName
Wscript.Echo “Daylight Day: ” & objItem.DaylightDay
Wscript.Echo “Daylight Hour: ” & objItem.DaylightHour
Wscript.Echo “Daylight Month: ” & objItem.DaylightMonth
Wscript.Echo “Daylight Name: ” & objItem.DaylightName
Wscript.Echo “Standard Day: ” & objItem.StandardDay
Wscript.Echo “Standard Hour: ” & objItem.StandardHour
Wscript.Echo “Standard Month: ” & objItem.StandardMonth

Wscript.Echo
Next

—————————————————————————————————————-

I have been able to get this to work on Windows XP , 2000/2003….enjoy!



Leave a Reply


powered by FreeFind