Solved

Synchronizing system time

Posted on 2004-04-14
6
201 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
New to SOAP and need some direction 10 42
This code tracks birthdays 3 57
How would you add MULTITHREADING to the attached C# code? 4 51
ASP.NET 5 Templates 2 65
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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.

914 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

22 Experts available now in Live!

Get 1:1 Help Now