![]() |
General Programming »
Date and Time »
General
Intermediate
License: The Code Project Open License (CPOL)
How to synchronise your Windows 2000 machine using SNTPBy Rob MandersonUsing the Windows 2000 Time Service to set the system clock |
C++Win2K, Visual Studio, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
There's nothing earth-shattering in this little article - everything I present can be found in MSDN but I thought I'd write it up to save someone else the time needed to track it all down.
The primary source of information I used is the MicroSoft Knowledgebase article Q223184. (Clickety not provided because the URL's sometimes change).
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters]
"LocalNTP"=dword:00000000
"Period"="SpecialSkew"
"NtpServer"="india.colorado.edu"
"NTP"="NTP"
"Type"="NTP"
The LocalNTP entry determines whether this machine, having been synchronised to an external source, will act as an NTP server for your local network.
The Period entry determines how often your machine synchronises to an external time source. SpecialSkew is the default value which occurs once every 45 minutes until 3 good synchronizations occur, then once every 8 hours (3 per day)
The NtpServer entry can be either an IP address or a url. In either case it should refer to a machine running the SNTP protocol. You'll see here that I'm using a server at what I presume is Colorado University. I got the server name by doing a search on Google looking for public SNTP servers. There are hundreds of such servers out there. As an aside, in general the providers of public servers request that each site synchronise only one or two machines via the external server and synchronise other machines at the site from those one or two externally synchronised machines.
You can also set the NtpServer entry from a command prompt by executing the following command
net time /setsntp:india.colorado.edu
You can query the current NtpServer setting by executing this command net time /querysntp
which will display the current server name (or IP).
The Type entry is used to specify whether the time service synchronises to the domain controller, to an external source, or doesn't synchronise at all.
Once you've set the registry entries you need to set the time service to run automatically upon boot. The service is called Windows Time in the services applet. On Windows 2000 Professional systems the service is installed but set to manual start. Set your clock to some wildly wrong value, start the service and the clock should change to indicate the machine is now synchronised to the external time source you specified.
January 7, 2004 - Initial version.
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 6 Jan 2004 Editor: Rob Manderson |
Copyright 2004 by Rob Manderson Everything else Copyright © CodeProject, 1999-2009 Web22 | Advertise on the Code Project |