Sometimes we run into problems caused by unsynchronized local date & time values. In this post we will see how to evaluate the difference between our computer an a public NTP server.
Find out how much out of sync are you
To do this, we are going to use “w32tm“.
Open a console or “cmd” and execute this command:
w32tm /stripchart /computer:pool.ntp.org /samples:6
In the output you can see the deviation of your system compared with the NTP server.
We can eliminate the text graphics from the output by using dataonly flag:
w32tm /stripchart /computer:pool.ntp.org /samples:6 /dataonly
In this example we are using pool.ntp.org as a public NTP server reference and six samples each time.
Public NTP servers
Here you have just a few NTP public servers to check against them:
pool.ntp.org us.pool.ntp.org europe.pool.ntp.org 0.debian.pool.ntp.org 1.debian.pool.ntp.org time.windows.com
Sync your computer
There are several ways to sync your computer, depending on whether you are part of a Windows Domain or not.
If you are part of a Windows Domain, talk with your System Total Administrator to fix the problem, because inside a domain, the Domain Controller with the PDC role keeps all domain in sync. If your are the Total Administrator, you have work to do.
My Computer is not in a Windows Domain
If you are not part of a Windows domain and you don’t need much precission, you can just adjust the date & time manually.
If you do need the time to be as accurate as possible, open a command window (cmd) as Administrator and write this to sync only if the difference in your time is not big:
W32tm /resync
If the difference is big, better use “/nowait” instead:
W32tm /resync /nowait
If you use /nowait, in a few moments the time should be syncronized.
My computer or server is in a Windows Domain
In this case do not waste any time trying to synchronize any computer except the Domain Controller with PDC Role.
First you need to know what is the Domain Controller with that role. A very fast way to know is by using DNS. You can see how in this post.
Connect to that Domain Controller and then synchronize as seen before.
The RPC server is unavailable. (0x800706BA)
If you find this error, it means probably that you are using /resync as follows:
W32tm /resync /computer:computername.domain /nowait
In this case you are not synchronizing the computer you are connected to, you are trying to sync “computername.domain”.
If you want to synchronize the computer you are connected to, just do no use /computer flag as seen in this post.
If you are trying to resync a computer remotely, then ensure your user has enough privileges and your network is set accordingly.
What is meant by a Domain Controller?
You can find more information about what a domain controller is in a Windows Network using Active Directory here (https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/get-started/virtual-dc/active-directory-domain-services-overview).
Or you can learn more about the concept of a Domain Controller in the wikipedia article (https://en.wikipedia.org/wiki/Domain_controller).
thanks for this. how do i prevent the offset from getting bigger? I am doing the resync every week as the offset when running w32tm /stripchart /dataonly keeps getting bigger.