Home > Windows Server Tips > > Script for remote synchronization of workstation's time with PDC
Windows Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 


Script for remote synchronization of workstation's time with PDC


Karanjit Singh Sidhu
12.20.2001
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


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:

Rate this Tip
To rate tips, you must be a member of SearchWindowsServer.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Server Room Design - Planning, Cooling, Maintenance
HomeTopicsBlogsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2004 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts