banner



How To Configure Ntp In Windows Server 2012

This article explains how to configure NTP on Windows Server 2012. If y'all're looking for Windows Server 2008 R2, see my article here. Remember, that in a domain environment, fourth dimension synchronization is taken care of only you should configure the PDC Emulator of a domain to sync externally since that is the server which decides what time it is!

Are you looking how to configure NTP using GPO, please read my commodity on it here.

This is all you need if y'all want to proceed information technology simple. Run using PowerShell as admin:

w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:Manual
Terminate-Service w32time
Start-Service w32time

If the machine is a VM inside Hyper-V, y'all have to disable time sync. Open VM settings -> Direction -> Integration Services and uncheck Fourth dimension Synchronization.

That should exist information technology!Want to know more? Doesn't work? Have yous screwed upwardly the config and want to start from the start? Go on on reading…

W32tm is the command to use. Sure, in that location are articles out there mentioning "cyberspace time", just yous should non utilize that. Some other also mentions editing the registry directly, only as Microsoft mentions in the article:It is recommended that you lot practise not directly edit the registry unless there is no other culling. But if y'all really want to check the registry, it's hither:HKLM\Arrangement\CurrentControlSet\Services\W32Time.

Which NTP-server to use? Or several?

The pool.ntp.org is a round-robin of random selected NTP servers. As they say "This is ordinarily good plenty for end-users". But you might want to add together several NTP-servers yourself for redundancy?

w32tm /config /manualpeerlist:"0.pool.ntp.org one.pool.ntp.org" /syncfromflags:MANUAL

Simply go along adding them with a space in betwixt them. Yep, I know some sites say you should separate them using comma but that doesn't work. Too, I've experienced issues that information technology configures correctly, merely still after restarting the service, it doesn't piece of work. I simply needed to practice the configuration again, and try once more. Also, remember that cut'n'paste from the web can sometimes screw upwards the " character then write it manually instead of cut'due north'paste to be sure.

Don't forget your firewall

If y'all got a firewall betwixt your host and the Internet, it might driblet udp/123 which is the NTP protocol. This is how information technology looked in my Cisco ASA FW:

Then I created a rule to permit it and after that it worked.

More info and debug logging

The following commands are quite useful which lists the current source, when information technology last sync'ed etc.

w32tm /query /status

Eventually, when the server tin't get time from the NTP server it will add an upshot to the upshot log:

Log Name: Arrangement
Source: Microsoft-Windows-Fourth dimension-Service
Event ID: 47
Level: Alert
Description: Time Provider NtpClient: No valid response has been received from manually configured peer pool.ntp.org afterwards 8 attempts to contact information technology. This peer will be discarded as a fourth dimension source and NtpClient will attempt to detect a new peer with this DNS name. The mistake was: The peer is unreachable.

Otherwise, when it'southward working, you will become:

Log Name: Arrangement
Source: Microsoft-Windows-Time-Service
Event ID: 35
Level: Information
Description: The time service is now synchronizing the system time with the time source pool.ntp.org (ntp.m|0x0|0.0.0.0:123->85.10.240.253:123).

You still getting issues? You can hands turn on debugging to a logfile which in this example is limited t0 x MB and include ALL debug entries.

w32tm /debug /enable /file:C:\Temp\w32tmdebug.log /size:10485760 /entries:0-300

Plow it off again with:

w32tm /debug /disable

Wait a lot of info in this debug log. For me, when information technology worked, the following entries showed it was working:

– Reachability:  peer pool.ntp.org (ntp.m|0x0|0.0.0.0:123->129.70.132.35:123) is reachable.
– Logging information: NtpClient is currently receiving valid time data from pool.ntp.org (ntp.m|0x0|0.0.0.0:123->129.70.132.35:123).

Just when I had my firewall blocking the packets, I would get the following. Don't trust this too much though, since I did get this when I allowed it in the firewall also, just when it was blocked, I did non get the entries in a higher place.

– Logging mistake: NtpClient has been configured to acquire time from one or more time sources, however none of the sources are currently attainable and no try to contact a source volition be made for one minutes. NTPCLIENT HAS NO SOURCE OF Accurate TIME.

Force a resync

If yous desire to force the client to resync, run:

w32tm /resync
Sending resync command to local figurer
The command completed successfully.

If you go the post-obit error, the computer can't reach the NTP-server(s).

The computer did not resync because no time data was available.

Start from scratch

If you lot completely screwed up the config, you can ever exercise the following control and it will completely erase and add a default W32time configuration:

Stop-Service w32time
w32tm /unregister
w32tm /annals

When doing the unregister I got the following error for some reason, but information technology seems like it worked anyhow.

The following error occurred: Admission is denied. (0x80070005)

Sometimes when doing the /register, I would become the following. This usually solved by waiting for a while. I would suggest you stop the service before doing /unregister. Otherwise, a reboot would probably solve most problems.

The following error occurred: The specified service has been marked for deletion. (0x80070430)

If you lot miss any of import information, let me know and I'll add together it.

Source: http://www.sysadminlab.net/windows/configuring-ntp-on-windows-server-2012

Posted by: bowersockle1995.blogspot.com

0 Response to "How To Configure Ntp In Windows Server 2012"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel