?
Solved

Synchronizing system time

Posted on 2004-04-14
6
Medium Priority
?
209 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
4 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 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

829 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