How to Configure Windows Server NTP
The correct server time is important for many applications and services. One of these services is domain controllers. It is important for computers running in a domain to have the correct time set. Otherwise, critical Active Directory services that require authentication, such as Kerberos, may experience serious problems.
Time synchronization in Active Directory can be performed in two different ways. The first method is to use the w32tm.exe command in the command prompt. The second method is to use Group Policy. This article will discuss the first method.
Configuring NTP with the Command Prompt
In this scenario, we will be configuring NTP on a server that is a Primary Domain Controller (PDC). To check if the server we are working on is a PDC, we can use the following command:
netdom query fsmo
Then, we can run the w32tm.exe command in the following format:
w32tm /config /syncfromflags:manual /manualpeerlist:[<time-server-address> [,<time-server-address> …]
Replace <time-server-address> with the IP address or DNS name of the NTP server. To specify multiple NTP servers, separate the addresses with commas. The following example uses the NTP Turkey addresses:
w32tm.exe /config /manualpeerlist:”0.pool.ntp.org,0x8 1.pool.ntp.org,0x8 2.pool.ntp.org,0x8″ /syncfromflags:manual /update
After the command is run, the w32time service is restarted with the following command:
net stop w32time && net start w32time
To synchronize the time of other ADC (Additional Domain Controllers) in the domain, run the following command:
w32tm /config /syncfromflags:domhier /update
If there are time synchronization issues between the PDC and ADC, we can use the following commands to troubleshoot the issue:
The following command shows the NTP source:
w32tm /query /source
The following command provides information about the synchronization status:
w32tm /query /peers
The following command can be used to re-register the NTP source after it has been changed:
net stop w32time
w32tm /unregister
w32tm /register
net start w32time