How to check remote server time via psexec

I tried the command as shown below. But can not see the server time.

psexec \\SERVER_NAME -i -u USERNAME -p PWD "C:\WINDOWS\system32\cmd.exe /c time /t" 

Or is there an alternative? Thanks.

+6
psexec
source share
2 answers
 net time \\SERVER_NAME 

Ps. This question really refers to ServerFault.

+15
source share

I have about 100 servers in my company. As soon as I had to check the system time on all servers. The solution was:

 psexec -d -i cmd /c nettime.bat 

contents of nettime.bat file:

 @echo off net time \\server01 >>c:\1.txt net time \\server02 >>c:\1.txt net time \\server03 >>c:\1.txt 
+2
source share

All Articles