![]() |
Setting time on remote computer
Back in the day, I had a couple of computers 'networked' (Lantastic Z). As is still true of computers today, their internal clocks would drift. Lantastic had a number of little utilities, one of which was a simple command to set the time on the remote computer to my local time.
I now have a server that is isolated from the internet. Periodically, I presume Windows (on that machine) tries to access the time server, but it can't get out. So, over time, the clock on the remote machine will drift. What I was looking for is a simple utility that sets the time on the remote machine to my local time. I figured this would be a simple task, but I keep finding things like setting up a client to reach a time server (no, I don't have access to the internet on that machine), or the most promising one was net time /set \\remote computer, but that wants to set my time to the remote time, which is wrong. Yes, I can remote desktop into the server and manually set the time (or use the net time command above) but that's not what I want to do (no manual activity required). I've got to believe this is a simple problem, but for the life of me I can't come up with a solution. |
If you can use the net time command on that computer, why don't you set an automated task with a batch script on that server that just repeats once a day? No manual activity required as long as that server has connectivity with your machine that you want to sync it with.
|
Originally Posted by eccentricfusion
(Post 25373619)
If you can use the net time command on that computer, why don't you set an automated task with a batch script on that server that just repeats once a day? No manual activity required as long as that server has connectivity with your machine that you want to sync it with.
Still - I can imagine a number of situations where there are one or more computers that you'd like to time sync on demand, and I would think there'd be an easy way to do it. I mean, I did it 20 years ago with a lot less sophisticated software, so surely the capability must be there somewhere. |
I don't understand. Your computer is isolated from the internet but on a local network of its own, and you want to set its time remotely from another computer on the network?
I believe the commands you want are: Code:
w32tm /config /computer:<computer name> /syncfromflags:manual /manualpeerlist:<IP address of the computer to get the time from>Or see this: https://support.microsoft.com/en-us/kb/151712 |
Originally Posted by BigLar
(Post 25373705)
Interesting idea - I have no guarantee that the local computer will be up at that time (nor that its IP adress won't change on me) but it might be worth a shot.
Still - I can imagine a number of situations where there are one or more computers that you'd like to time sync on demand, and I would think there'd be an easy way to do it. I mean, I did it 20 years ago with a lot less sophisticated software, so surely the capability must be there somewhere. If this is such a problem, you could always set up your own NTP server (or add the role to an existing device on your network, such as a NAS) and point that server to the NTP server, but I'm not really understanding why it is a problem to begin with?
Originally Posted by gfunkdave
(Post 25373956)
I don't understand. Your computer is isolated from the internet but on a local network of its own, and you want to set its time remotely from another computer on the network?
I believe the commands you want are: Code:
w32tm /config /computer:<computer name> /syncfromflags:manual /manualpeerlist:<IP address of the computer to get the time from>Or see this: https://support.microsoft.com/en-us/kb/151712 |
Originally Posted by gfunkdave
(Post 25373956)
I don't understand. Your computer is isolated from the internet but on a local network of its own, and you want to set its time remotely from another computer on the network?
Originally Posted by eccentricfusion
(Post 25374174)
...but I'm not really understanding why it is a problem to begin with?
I used to do it very easily and I'm surprised it isn't included as a sub-function of net or somewhere in the Power Shell. At least, I can't find it. I was hoping someone else would know of the way without requiring buying/developing more hardware/software, etc. :) A year from now, if the time has drifted by more than a few minutes, I can always log onto it remotely and apply the net command in reverse. I can also drive my car backwards by sitting in the back seat and connecting ropes to the steering wheel ... I used to be able to do it from the front seat and I was hoping you guys knew how that worked. :) |
If you need to keep time sync'd and there isn't internet, another option is to buy an ancient Garmin GPS off eBay that supports NMEA and use GPS to sync the clock. I believe either Tardis or Dimension4 programs will read the GPS and go from there. We used to use this method with satellite TV uplink/production trucks. I still have an old Garmin GP48 doing exactly this out in the field.
|
Originally Posted by BigLar
(Post 25374272)
It's not a real problem. There are a number of ways of getting the desired result, which is to sync up the time on the remote computer (which cannot connect to the NIST server or any other time service) but what I'm looking for is a simple way to run a script/program on the local computer to set the time based on the local time. Not a big deal, as the remote time doesn't drift that much.
Originally Posted by KRSW
(Post 25374704)
If you need to keep time sync'd and there isn't internet, another option is to buy an ancient Garmin GPS off eBay that supports NMEA and use GPS to sync the clock. I believe either Tardis or Dimension4 programs will read the GPS and go from there. We used to use this method with satellite TV uplink/production trucks. I still have an old Garmin GP48 doing exactly this out in the field.
Originally Posted by BigLar
(Post 25374272)
II was hoping someone else would know of the way without requiring buying/developing more hardware/software, etc. :)
|
Originally Posted by BigLar
(Post 25374272)
The computer has a static IP and has no entry for a DNS server. It can not (unless it knows the actual IP) announce its' presence on the internet to anyone. I've never received an update from Microsoft, for instance. I talk to it by its' static IP address.
|
Originally Posted by BigLar
(Post 25374272)
The computer has a static IP and has no entry for a DNS server. It can not (unless it knows the actual IP) announce its' presence on the internet to anyone. I've never received an update from Microsoft, for instance. I talk to it by its' static IP address.
It's not a real problem. There are a number of ways of getting the desired result, which is to sync up the time on the remote computer (which cannot connect to the NIST server or any other time service) but what I'm looking for is a simple way to run a script/program on the local computer to set the time based on the local time. Not a big deal, as the remote time doesn't drift that much. I used to do it very easily and I'm surprised it isn't included as a sub-function of net or somewhere in the Power Shell. At least, I can't find it. I was hoping someone else would know of the way without requiring buying/developing more hardware/software, etc. :) A year from now, if the time has drifted by more than a few minutes, I can always log onto it remotely and apply the net command in reverse. I can also drive my car backwards by sitting in the back seat and connecting ropes to the steering wheel ... I used to be able to do it from the front seat and I was hoping you guys knew how that worked. :) In this thread, we already gave you a few options that are cost free? I assume that you are running a Windows server, if that is the case, it's just a scheduled task with a batch file containing a few lines. No cost at all. Your powershell script would look exactly the same as the required net commands, besides the extension being ps1 versus bat. |
the computer is on a lan, but there's no internet access?
You know, you can setup one or more of the computers on the lan to be an ntp (network time protocol) server. I think you can even configure it so it will broadcast the time of day. Again, I don't remember how to do it, it's somewhere in the management console in Windows IIRC. (just google windows ntp server) It works better if that computer can access a better time source, but if it can't it just uses it's own idea of the time of day, which can still drift. But on a LAN the important thing is generally that all the computers have the same idea of the current time. All of this is easier to do in linux or pretty much any unix variant. :) |
Originally Posted by LIH Prem
(Post 25386476)
the computer is on a lan, but there's no internet access?
It is only used to host the RAID drives, which are available to any computer on my network (if you know the IP address and maybe password). I store most of the stuff I need there, and when I need it on the computer I'm working on at the moment, I have the appropriate folders mapped and it acts like a local drive. Since all the important stuff is in one place, I'm always working on the latest version of whatever it is I'm doing, and I don't have to have large drives on the local desktop/laptop. It sleeps after 20 minutes or so of inactivity and can only be woken by Wake-on-Lan packets; I have little batch file to do that - just click on the icon and the server wakes up. In reality, the server spends most of its time sound asleep using very little power but always ready to spring into action. :) Remember - I don't go out and buy new computers, drives, monitor, etc. just to add a new computer. These computers were obtained in the $5 - $15 range, often with monitor included., and I have piles of drives and bags of memory. Having an entire computer dedicated to one task is not wasteful by any means, and even though they might not be up to current standards they are more than adequate for their assigned task.
Originally Posted by LIH Prem
(Post 25386476)
All of this is easier to do in linux or pretty much any unix variant. :)
|
Originally Posted by BigLar
(Post 25386772)
Yes - by design.
Just make one the time server, point the others (ntp clients) at that one, or have them pick up the broadcasts from the time server. That way they will all have the same time, and then you can occasionally adjust the clock on the time server to compensate for the inherent drift. Just use the (statically assigned) IP address of the one you pick to be the server when you configure the time service on the clients. I forget if Windows allows you to configure it for broadcasts or not, but it's even easier if it allows you to set it up that way. I have no idea how much a reference clock costs. Apparently they use GPS now. It would be interesting to see if there's a cheap/easy way to add a reference clock to your network. Looks like there's a w32time service, and you have to configure it via the registry. ugh. -David -David |
The lab I worked in used to have a Heathkit device that decoded the NIST radio time signal and output an ASCII string to set our time server before we switched to a GPS receiver. I doubt that you can find anything like the radio easily but someone might have one in a cupboard! It looks as if simple GPS devices might be quite cheap if $50-100 is in your budget. The commercial grade devices are rather more. Something that connects to a USB port would likely be cheaper than one with built-in networking but the latter would actually work as the time server. It's getting hard these days to buy the chips and build one.
|
It seemed that Psexec would solve my problem, but I had the common Access Denied error.
So, after fiddling with it a bit and keeping straight which computer was "active" when the file would run, I wound up taking eccentricfusion's advice and set up a scheduled task. So the desired little program runs on the proper machine and all is well. So far. Still have to figure out the problem with Psexec. Something to do with ADMIN$ shares and so forth. The explanations given seem reasonable, but you have to already know what they're talking about before you can understand what they're talking about. Reminds me of my early efforts to get Linux up and running ... I was essentially told that, if I didn't already know all this stuff, I wasn't worthy of running Linux. :) |
| All times are GMT -6. The time now is 8:59 am. |
This site is owned, operated, and maintained by MH Sub I, LLC dba Internet Brands. Copyright © 2026 MH Sub I, LLC dba Internet Brands. All rights reserved. Designated trademarks are the property of their respective owners.