How to check NTP Time Source?

Soldato
Joined
11 Jun 2004
Posts
4,222
Location
Middlesex, London
Hi guys,

Please could you tell me the easiest way or command to check NTP config on Windows Server 2003 and Windows Server 2008.

...is there also a way to see or check if it's working? i.e. is the Server connecting the NTP Time Source and syncing correctly?

Thanks
 
Yep, from the command line use w32tm - It's pretty well documented so I'll leave you to do the rest.

Just remember, in a domain everything sync's back (via DC's for member computers/servers) to the PDC emulator, so provided you have that set to a reliable time source everything in the domain 'should' sync up with no intervention

############
Below is a script I have used to check the drift between a server and a DC:

w32tm /stripchart /computer:ReferenceServerGoesHere.domain.local /dataonly /period:300 >c:\w32tmlog.txt

You can tweak the time period as required
 
Last edited:
Just to note. If NTP is not synchonising you'll see it in the server logs.

Also if the server time is TOO far away from the actual time it will NOT synchronise (i think it's over an hour but don't quote me) You would have to manually set the time close to the actual NTP time to get it working again.
 
Ok - so this is what I am getting back:

C:\>
C:\>w32tm /stripchart /computer:timehost
Tracking timehost [10.54.0.19:123].
The current time is 09/07/2013 11:09:53.
11:09:53 d:-00.0001402s o:+00.7124668s [ | *
]
11:09:55 d:-00.0001345s o:+00.7120847s [ | *
]
11:09:57 d:-00.0001325s o:+00.7121939s [ | *



...so does this mean - this server is looking at '10.54.0.19:123' for it's Time Source?
 
No, what that command is doing is checking the local time against timehost - you need to use the other w32tm switches to actually configure anything.
I use the stripchart to confirm that servers are synced up as they should be.

d: is the delay from the local machine to the server you requested.
o: is the offset in time between the local machine and the server you requested.

In your case the delay is very low, but your local machine has drifted 0.7s from timehost.
This isn't the end of the world, but it doesn't actually confirm where you are syncing from - and without knowing your network layout I wouldn't want to advise any further on that.
 
Thanks

ok - What I am trying to find out is:

1) - Where are we syncing from?
2) - is this working?

How can I do this please?

I don't want to configure or 'change' anything
 
Are your servers on an active directory domain?

Look for Event ID 35 in the Windows System Event Log - if it syncs properly you should see something like this:

The time service is now synchronizing the system time with the time source domaincontroller.yourdomain.com (ntp.d|0.0.0.0:123->(Domain Controller IP Address):123)
 
1.)You can check all the setting in the registry:
hklm\currentcontrolset\services\w32time\parameters

ntpserver and type are the ones to look at.

2.) you can use the event logs to see if time is syncing properly. If in douby force the time to sync and check the events:
w32tm /resync (i think)
 
"w32tm /monitor" will show you the current time source. "w32tm /resync" will instruct the computer to update the time from the NTP server. It'll respond "The command completed successfully" if it was able to update the time, otherwise you'll get something like "The computer did not resync because no time data was available". I have wasted many hours trying to configure the Windows NTP client on our customers' servers via the registry, now I just run the following on their PDC in a batch file instead;

Code:
w32tm /config /manualpeerlist:uk.pool.ntp.org,0x1 /syncfromflags:MANUAL
net stop w32time && net start w32time
w32tm /config /reliable:yes /update
net stop w32time && net start w32time

This configures the NTP client to use uk.pool.ntp.org as the time source, and then configures the NTP server to advertise itself as a reliable time source. As a PDC it should advertise as a reliable time source anyway, but I like to instruct it to just in case. I've found that w32tm doesn't always apply the commands properly unless you restart the service, so I just restart the service after I apply each instruction. As covenantuk said, if the time difference is too great the windows time service won't update the time, but you can just manually change the time first then do the resync.
 
On the Domain PDC Emulator:
Code:
w32tm /config /manualpeerlist:"0.uk.pool.ntp.org 1.uk.pool.ntp.org" /syncfromflags:manual /reliable:yes /update

On every other Windows computer on the domain:
Code:
w32tm /config /syncfromflags:domhier /update

I've never needed to stop and start w32tm -- just check the event logs, you should see it very quickly reporting success.
 
Back
Top Bottom