0

We have a PSExec command to run batch scripts on a remote machine.

When we run it from the machine where the self hosted agent is, it shows the job(batch script) log, on the command window.

But when we run the same command from Azure pipeline via Command Line task, it is not showing the log.

All it shows is

cmd exited on NTCUPX01 with error code 0.

Is there anyway we can display the output, so that it is useful to anybody who is running the pipeline?

Matt
  • 3,658
  • 3
  • 14
  • 27
Krishnan
  • 11
  • 3
  • Do you use the fully qualified machine name when kicking off psexec? Here is a reference [case](https://stackoverflow.com/a/1221741/11508192). In addition , can you share your command? So that we can reproduce your issue. – Hugh Lin Sep 11 '20 at 03:30
  • Here is the command i am using, D:\TestData\PSExec -accepteula \\NT12CAPX -u username -p pwd E:\Jobs\Copy1.bat – Krishnan Sep 11 '20 at 21:02
  • As a suggestion,you can try to `runas /user:domain\administrator "D:\TestData\PSExec -accepteula \\NT12CAPX -u username -p pwd E:\Jobs\Copy1.bat"` . Here is the [reference](https://community.spiceworks.com/topic/151081-psexec-returning-error-code-0-but-not-working). – Hugh Lin Sep 15 '20 at 10:17
  • Thank you @HughLin-MSFT, But it is asking for password which I wouldnt know. Is there anyother way? – Krishnan Sep 16 '20 at 17:08

0 Answers0