Solved

Synchronizing system time

Posted on 2004-04-14
6
200 Views
Last Modified: 2010-04-15
Hey guys,
I'm not sure if this is the right forum for this question.
I have a time server that I want a number of windows XP machines to synchronize with.  How can I configure them so that they try to synchronize at 3:00 am.  I don't want to set intervals as in "run every x number of hours".  I want them to sync at a specific time.  Is this possible?  Could this be done programmatically?

Thanks
0
Comment
Question by:fifo123
  • 3
6 Comments
 
LVL 22

Expert Comment

by:_TAD_
ID: 10825545


The best method would probably be to create a window's service on your "time machine"
 he he

This service would do three things:

1) Poll the time once every second (or two depending on how accurate you want to be).
2) At 2 AM, gather a list of all servers on the network (either by IP or by alias)
3) at 3 AM, log into each server and set the time to 3AM



As a control point, I would create a global flag isRunning which is set to false most of the time.  Then when the application is gathering data or updating servers then the flag will be set to true (so we don't duplicate processes).

I would probably also put the 3AM update into a seperate thread for each server.  So at 3AM your CPU on your time machine will jump to 60% or 80% (and network traffic will spike), but then at least then all computers will be updated at the same time.


Your other alternative (which we use at my job) is to have each computer at a scheduled time check the time server and then update its own time with whatever the time machine has.

We do this because of reboot and backup schedules.  if all of the machines were going to be updated at the same time, then we could not perform backups or reboots at 3AM.



0
 

Author Comment

by:fifo123
ID: 10825843
Hey TAD,
Thanks for the response.
In the implementation used at your job, how do you guys schedule each computer to check the time server at a specific time?  Do you have a custom application that does this?  If so, do you know of a sample I can take a look at anywhere?

I have been trying to edit the registry entry at:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ W32Time \ TimeProviders \ NtpClient \

but I don't see anything that would allow me to set a schedule time.  It only allows intervals.

thanks for your help.
0
 
LVL 22

Expert Comment

by:_TAD_
ID: 10828145


For servers that we re-boot on a weekly basis, we re-sync at boot up.  So we are not sync-ing at "3 AM", we are instead going out to the time server and grabing the current time and then setting the machine clock to that time.   This happens on a periodic rate for servers that stay on all the time (like domain servers), or else happens at reboot for production application servers.


As for code... I really think it is a simple DOS batch program that is executed at startup or is scheduled to execute by the Win NT/2000 scheduler.
0
 
LVL 22

Accepted Solution

by:
_TAD_ earned 50 total points
ID: 10828202


as for changing reginstry entries in DOS, the command is pretty simple.

To query your registry in DOS

reg query HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient

type the following for help
reg /?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now