40 pts.
 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
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

Software/Hardware used:
ASKED: May 27, 2008  5:56 AM
UPDATED: May 27, 2008  1:22 PM

Answer Wiki:
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 = "domainadministrator" ' 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:WINDOWSSYSTEM32 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>
Last Wiki Answer Submitted:  May 27, 2008  7:45 am  by  alessandro.panzetta   9,695 pts.
All Answer Wiki Contributors:  alessandro.panzetta   9,695 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _