[JIRA] (JENKINS-49159) Cannot run Powershell Start-Job with credentials passed from Jenkins

5 views
Skip to first unread message

vs29musw+jenkins@secureforward.nl (JIRA)

unread,
Apr 7, 2020, 5:58:03 AM4/7/20
to jenkinsc...@googlegroups.com
Alexander Bakker commented on Bug JENKINS-49159
 
Re: Cannot run Powershell Start-Job with credentials passed from Jenkins

I'm encountering the exact same issue. Some additional information that may help to narrow this down:

  • It is invoked as follows:
    Start-Job -Credential $cred -ArgumentList ($arg1, $arg2) -ScriptBlock { }

    Where $cred is a PSCredential.

  • Jenkins is running as "Local Service" on Windows Server 2019.
  • The script with Start-Job in it runs fine when run from a PowerShell prompt on the same machine. The issue only occurs when Jenkins runs the PowerShell script.
  • The workaround that Michal Zatloukal suggested does not work for me.

I'm kind of at a loss here. If anyone has any suggestions how I could help debug this issue, please let me know.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

vs29musw+jenkins@secureforward.nl (JIRA)

unread,
Apr 7, 2020, 6:00:03 AM4/7/20
to jenkinsc...@googlegroups.com
Alexander Bakker edited a comment on Bug JENKINS-49159
I'm encountering the exact same issue. Some additional information that may help to narrow this down:
* It is invoked as follows:
{code:java}
$job = Start-Job -Credential $cred -ArgumentList ($arg1, $arg2) -ScriptBlock { }
$job | Receive-Job -AutoRemoveJob -Wait
{code}

Where $cred is a PSCredential.

* Jenkins is running as "Local Service" on Windows Server 2019.
* The script with Start-Job in it runs fine when run from a PowerShell prompt on the same machine. The issue only occurs when Jenkins runs the PowerShell script.
* The workaround that [~myxal] suggested does not work for me.


I'm kind of at a loss here. If anyone has any suggestions how I could help debug this issue, please let me know.

vs29musw+jenkins@secureforward.nl (JIRA)

unread,
Apr 9, 2020, 6:48:02 AM4/9/20
to jenkinsc...@googlegroups.com

I'm currently working around this issue by using Invoke-Command instead, and allowing PowerShell Remoting sessions with CredSSP authentication on localhost from localhost.

Reply all
Reply to author
Forward
0 new messages