ReneGe
asked on
Batch File: NET TIME (or, w32tm)
Hi there,
I need the followings:
-Batch file or Command line, to setup a Domain Controller to sync it's time with an Internet Atomic Clock, every 30minutes
-Batch file or Command line, to set all the domain PCs to sync their clock with the domain controller every 30minutes
-Command line to force remote PC to sync it's time with the domain controller immediatly.
Thanks for your help,
Rene
I need the followings:
-Batch file or Command line, to setup a Domain Controller to sync it's time with an Internet Atomic Clock, every 30minutes
-Batch file or Command line, to set all the domain PCs to sync their clock with the domain controller every 30minutes
-Command line to force remote PC to sync it's time with the domain controller immediatly.
Thanks for your help,
Rene
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I just successfully scripted it.
Have any better ideas?
I'll close this post tomorrow
Cheers
Have any better ideas?
I'll close this post tomorrow
Cheers
@ECHO OFF
::SEPERATE WITH A COMMA, AND WITHOUT "\\"
SET PDCemulators=DC-LAN1,DC-LAN2,DC-LAN3
::PDCEmulators SpecialPollInterval In Seconds and in decimal (not HEX)
SET SpecialPollInterval=900
::ListOfPCs, ENTER HOW PC NAMES START, AND SEPERATED WITH A SPACE.
SET ListOfPCs=\\PCLAN1 \\PCLAN2 \\PCLAN3
REM SETTING UP PDC EMULATORS
FOR %%A IN (%PDCemulators%) DO (
PSEXEC \\%%A w32tm /config /manualpeerlist:"0.ca.pool.ntp.org,1.ca.pool.ntp.org,3.ca.pool.ntp.org" /reliable:yes /update
REG ADD "\\%%A\HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" /v SpecialPollInterval /t REG_DWORD /d %SpecialPollInterval% /f
::RESTARTING TIME SERVICE
PSEXEC \\%%A NET STOP w32time
PSEXEC \\%%A NET START w32time
::UPDATING TIME FROM INTERNET TIME SERVERS
PSEXEC \\%%A W32tm /resync
)
REM SYNCHRONISING ALL DOMAIN PCs
FOR /F %%A IN ('NET VIEW ^| FINDSTR -i "%ListOfPCs%"') DO PSEXEC %%A W32TM /resync
PAUSE
EXIT
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for ReneGe's comment http:/Q_27328642.html#36602568
Assisted answer: 500 points for pony10us's comment http:/Q_27328642.html#36601933
for the following reason:
Thanks pony for helping.<br /><br />I will post script updates.<br /><br />Cheers,<br />Rene
Accepted answer: 0 points for ReneGe's comment http:/Q_27328642.html#36602568
Assisted answer: 500 points for pony10us's comment http:/Q_27328642.html#36601933
for the following reason:
Thanks pony for helping.<br /><br />I will post script updates.<br /><br />Cheers,<br />Rene
ASKER
Could you please cancel my close request?
Thanks
Thanks
ASKER
Sorry for the confusion, and thanks again for your help.
Cheers,
Rene
Cheers,
Rene
There is a tool you could look at here: http://www.dougknox.com/xp/utils/xp_inet_time.htm
ASKER
Thanks
ASKER
Thanks for helping,
Rene