Search code examples
batch-filewindows-server-2008remote-accesspsexec

PsExec command issue between two windows servers


I'm trying to run a batch file from remote Server1 onto remote Server2 (both are Windows server 2008 R2) located on common domain using below command:

psexec \\Webtestserver2 -u sunny -p sunny2on_test -d -i cmd /c D:\files\script.bat 

NOTE: On both the servers Drive:D is shared on the common domain.

and I get below output:

PsExec could not start cmd on Webtestserver2
Logon failure: unknown user name or bad password.
  1. Login username and password for both the Servers are exactly same.
  2. I am able to connect to both the Servers seperately with RDP and net use command is also working between two servers.
  3. Time is also synchronized throughout two servers.
  4. I can ping each of them from the other one.

What is wrong with my psexec command ?


Solution

  • You need to specify the domain name, e.g. psexec -u DOMAIN\sunny ..., otherwise psexec will try logging as SERVER2\sunny, I believe.