There are so many different ways and articles out there on how to configure NTP in Windows and every time I had to look it up. So i decided to write my own article for my own reference for the setup in my lab so I don't have to Google it myself next time
This article is for Windows 2008 R2 and that's all I've tested it on so far...
First, the basics. This is all you need if you want to keep it simple.
w32tm /config /manualpeerlist:pool.ntp.org,0x8 /syncfromflags:MANUAL net stop w32time net start w32time
If the machine is a VM inside Hyper-V, you have to disable time sync. Open VM settings -> Management -> Integration Services and uncheck Time Synchronization. [Thanks Todd].
That should be it! Want to know more? Doesn't work? Have you screwed up the config and want to start from the beginning? Keep on reading...
W32tm is the command to use. Sure, there are articles out there mentioning "net time", but you should not use that. Some other also mentions editing the registry directly, but as Microsoft mentions in the article: It is recommended that you do not directly edit the registry unless there is no other alternative.
The pool.ntp.org is a round-robin of random selected NTP servers. As they say "This is usually good enough for end-users". But you might want to add several NTP-servers yourself for redundancy?
w32tm /config /manualpeerlist:"ntp1.sp.se ntp2.sp.se",0x8 /syncfromflags:MANUAL
Just keep adding them with a space in between them.
If you got a firewall between your host and the Internet, it might drop udp/123 which is the NTP protocol. This is how it looked in my Cisco ASA FW:
<< Indietro