Solved

Set the Time zone with a script or GPO

Posted on 2009-07-14
2
695 Views
Last Modified: 2013-11-09
Set the Time zone with a script or GPO

I have many computers in the domain that don't have clock settings the same some of them are one hour difference because of the time zone which is set up different.
I need a script or if there is a GPO that can set all computers to the correct time and same time zone.

Thanks
0
Comment
Question by:jskfan
2 Comments
 
LVL 5

Accepted Solution

by:
Ubertam earned 500 total points
ID: 24849969
http://support.microsoft.com/kb/914387/

Gives all the details, including script examples.
0
 

Author Comment

by:jskfan
ID: 24864408

This script works just perfect it retrieves the clock time, but for only one computer how do I modify it to retrieve the time of many computers, if you can tweek it to show the zone will be more than perfect.


strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem")
 
For Each objItem in colItems
    strTime = objItem.LocalDateTime
    dtmTime = CDate(Mid (strTime, 9, 2) & ":" & Mid(strTime, 11, 2) & ":" & _
        Mid(strTime, 13, 2))
    dtmTime = CDate(dtmTime)
    Wscript.Echo FormatDateTime(dtmTime, vbFormatLongTime)
Next
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now