0
votes

My Power shell batch file fails when I run the Jenkins job and if I right click the batch file and execute with Powershell it succeeds. Jenkins runs under a admin service account.

The batch file stops IIS in a remote dmz machine using PAexec. So this is the content in my Batch file ---

$machineName = "\\machine.dmz"
$commandTest = "`"E:\jenkins\jobs\GTS4 - Deploy\workspace\Deploy\tools\paexec.exe`" $machineName  iisreset -stop";
Write-Host "Running command: ${commandTest}";       
Run-Command $commandTest;

Is it a privilege issue? I am admin in Jenkins server and the service account which Jenkins uses is also admin. What could be the issue. Why jenkins fails to stop IIS in remote DMZ machine. ?

1
This was solved by adding the Service account under which Jenkins runs as an admin in the remote dmz machine.arunjith

1 Answers

0
votes

In windows, service accounts doesn't see shared drives