How to find out local and remote time difference?
Question
I face strange situation: I suspect some of Windows PCs in the network are suddenly become out-of-sync with our NTP servers. So I need something I can remotely check time difference between Windows machine and NTP server. What can be the best is to log that difference so I will be able to graph it and see the moment it happens to debug further.
And, of course, I'd prefer remote tool that I'll run on some extra PC so I won't install anything on each of client PCs around network.
I also find out that some of clients are happy to sync with unix-based NTP server and won't sync with Windows-based (DC), while some other 'like' Windows-based NTP server. Something strange, indeed, but the network is legacy and I can suspect pretty everything.
Solution
Cygwin runs nicely on Windows, and you can use "ntpdate -q" to find the date on the remote server and "date" to get the machine on the local server. A short shell script later and you should be done -- you can then automatically capture the time difference.