Remotely Synchronizing the Time Between Two Computers


Cannot log into remote system due to time discrepancy?

WrongTime

A while ago Microsoft had just one command to fix it, described in KB151712.

AT \\ComputerA <HH:MM:SS> /INTERACTIVE “NET TIME \\ComputerB /SET /Y”

Unfortunately, if you run the AT command now, the output will be

The AT command has been deprecated. Please use schtasks.exe instead.

Even though SCHTASKS is way more powerful than AT, the command is a bit more complicated. The main idea is the same: to run NET TIME as a scheduled task. The implementation is different.

First of all, let’s assume that ComputerA does not have correct time. On your computer run these two commands

NET TIME
Current time at \\DomainController is 3/8/2016 9:20:41 AM
The command completed successfully.

NET TIME \\ComputerA
Current time at \\ComputerA is 3/8/2016 9:22:41 AM
The command completed successfully.

NET TIME without parameters in the first command gives the time on the time source, that is PDC in Windows domain. The second command gives the time on ComputerA

Here’s the last step

SCHTASKS /Create /S ComputerA /SC ONCE /ST 09:25 /RU SYSTEM /TN SetTime /TR “NET TIME \\DomainController /SET /Y”

Set up start time (/ST parameter) a minute or two ahead of current time of ComputerA. Remember, this scheduled task will run on ComputerA and will use its time.

Wait until this time comes and check the results running both NET TIME commands again

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: