server time – any tools I can to use or group policy to (change time of computer member of Domain to synchronies time of server if I change the time of server) directly without waiting

40 pts.
Tags:
Group Policy
Microsoft Windows Server 2003
If there any tools I can to use or group policy to (change time of computer member of Domain to synchronies time of server if I change the time of server) directly without wait

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hello Mizomotaz,
you can use the <a href=”http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx”>PSEXEC</a> and the command line <b>w32tm /resync /rediscover</b>.
Hereafter an example of a VBScript that will read computer names from a text file and will launch the correct command by using the <i>PSEXEC </i>utility:

<pre>
Dim arrFileLines()
Dim ExecutionPath ‘ where the script is executed
Dim UserName ‘the username with administrator privilieges
Dim Password ‘ the user’s password
Dim MyCommand ‘ the command to be launched
UserName = “domain\administrator” ‘ changeme
Password = “MyPassword” ‘ changeme
MyCommand = “w32tm /resync /rediscover & exit”
ExecutionPath = Replace(Wscript.ScriptFullName,WScript.ScriptName,””)
i = 0
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set objShell = Wscript.CreateObject(“Wscript.Shell”)
Set objFile = objFSO.OpenTextFile(“computers.txt”, 1)
Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close
For l = LBound(arrFileLines) to Ubound(arrFileLines)
objShell.Run “cmd /c ” & ExecutionPath & “\psexec ” & arrFileLines(l) & ” -u ” & UserName & ” -p ” & Password & ” ” & MyCommand,6,1
Next
Wscript.Quit(0)
</pre>

For the <i>PSEXEC </i>tool you may copy it in C:\WINDOWS\SYSTEM32 or save it in the same folder where the script is located.

P.S. The computers.txt must have computer one computer name on each line.
Example:
SERVER1
SERVER2
SERVER3
etc

I hope this helps.

————

In addition to that you can use a group policy to force all the computers to set thier time to a domain server or internet time server. Under “Computer Configuration > Administrative Templates > System > Windows Time Service > Time Providers” setup the “Configure Windows NTP Client” option to your local time server. The only way to force computers to update when you make a change to the time server would be to manually tell the machines to update, but this will have the machines check it at the specified interval and update them selves. You should set your time server to auto update from an internet time server to ensure that it is correct to the time at all times.

You can also setup a login batch file which uses the dos NET TIME command to set the local time to any server you specify. The command to do this is: If you have a way to run commands remotly on machines (such as via the AT comand) you can have all the machines execute the NET TIME command below which would then sync the time.

<pre>NET TIME \\ServerName /SET /YES</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following