none
net time command not working through psexec but others commands are working fine RRS feed

  • Question

  • Hi,

    i m working to run net time on multiple Servers, but when i tried psexec this command is not working however other commands are working , any hint ?

    i tried net time its gives error but when i tried just cmd.exe its works ..


    • Edited by Balal Ahmad Sunday, August 18, 2019 4:38 AM update title
    Sunday, August 18, 2019 4:25 AM

All replies

  • By default the only accounts that can change the system time are 'Administrators' and 'Local Service'
    Check whether UAC is enabled for the account on the target machine.

    Alternative methods for synchronizing the computer's clock

    Run with logged on user privilege (user must be an administrator on remote computer.)

    psexec.exe \\computername w32tm /resync

    Run the remote process with the system account (-s)
    psexec.exe -s \\computername w32tm /resync

    Once you get one of the above commands to work you can execute the command on multiple computers.

    1.Create a text file with a list of names of the remote computers. Save in same directory as psexec.exe.

    PC1
    PC2
    PC3

    Then create a batch file (timesync.bat) with the command to be executed remotely. Save in same durectory as psexec.exe

    Note: Avoid having spaces in the file path. Enclose in " " if there are spaces in path

    psexec @c:\temp\hostnames.txt -ctimesync.bat

    psexec @"c:\temp\host names.txt" -ctimesync.bat

    or.. type the command to be executed remotely
    psexec @c:\temp\hostnames.txt -c w32tm /resync

    SelloD



    • Edited by SelloD Sunday, August 18, 2019 5:43 AM
    Sunday, August 18, 2019 5:39 AM