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.
What is wrong with my psexec command ?
You need to specify the domain name, e.g. psexec -u DOMAIN\sunny ...
, otherwise psexec will try logging as SERVER2\sunny, I believe.