Script for remote synchronization of workstation's time with PDC

Here's a small batch file that allows the administrator to remotely synchronize a workstation's time with the PDC.

Here's a small batch file that allows an administrator to remotely synchronize a workstation's time with the PDC...

(primary domain controller) as the defualt domain user doesn't have the right to sync the time of the PC.

To sync the workstation time with the PDC, the admin will need to copy the small batch file FixTime.bat from below. Also, he or she will need the utility PsExec.exe from Sysinternals.com.

The contents of the batch file are as follows:

===FixTime.bat===

@echo on
If .%1==. goto syntax

rem
rem Replace with the name of the domain.
rem

psexec %1 net time //domain: //set //y

goto end

:syntax

echo.
echo.
echo * Invaild Argument *
echo.
echo.
echo Syntax :
echo Fixtime MachineName
echo.
echo.
goto end


:end
==========================

This batch file needs to be executed from the same directory as the PsExec.exe or you can copy psexec.exe to a folder in the PATH variable so that it can be executed from any place. Also, the batch file takes into account that the net.exe and net1.exe files are available in the path variable of the remote PC.

Thats it. Just type:

Fixtime

And the machine's time will be synced with the PDC/BDC (backup domain controller) of the domain.

Note:- As this command needs Admin privilege to execute, you will need to execute this batch file while logged on as a domain admin on your PC. Code:
This was last published in December 2001

Dig Deeper on Windows Operating System Management

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchServerVirtualization

SearchCloudComputing

SearchExchange

SearchSQLServer

SearchWinIT

SearchEnterpriseDesktop

SearchVirtualDesktop

Close