to download it here http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
Example for commands to change the peer of the NTP servers are as below
Code:
psexec @C:\Fouad\servers.txt -u admin -p password -d w32tm /config /manualpeerlist:"rentime3.egyeng.com,0x8 rentime2.egyeng.com,0x8" /syncfromflags:MANUAL >> c:\Fouad\report.txt 2>&1
psexec @C:\Fouad\servers.txt -u admin -p password -d w32tm /config /update >> c:\Fouad\report.txt 2>&1
psexec @C:\Fouad\servers.txt -u admin -p password -d net stop w32time >> c:\Fouad\report.txt 2>&1
psexec @C:\Fouad\servers.txt -u admin -p password -d net start w32time >> c:\Fouad\report.txt 2>&1
pause
-u admin -p password : admin and password to be used on servers / delete this part if you will use same account you run the batch with it.
Small simple batch
Code:
psexec.exe \\Servername cmd \c \\mybatch.bat
NOTE: put PsExec.exe , Servers.txt and your batch on same folder which named here Fouad under c drive mybatch.bat
Comments
Post a Comment