Controlling user Jenkins runs as

323 views
Skip to first unread message

Stuart Henderson

unread,
May 24, 2016, 6:50:08 PM5/24/16
to Jenkins Users
Apologies in advance for being a noob.

I'm having big problems on our new Jenkins 2 server on Windows 2012 and would really appreciate some advice/help.

I'm trying to run a Powershell script to establish a remote session to another (same domain) Windows 2012 machine. I can do this no trouble at all from the Powershell command line. I installed the Powershell plugin and thought it would be a walk in the park to use that to drive the Powershell script to do what I need. Uh hu....

I get "access denied" messages every time. I think it might be because the Powershell script run by Jenkins is executing as a different user. I have tried injecting user names and passwords into the build - but I'm not confident that the correct user is being selected. I can run local Powershell scripts no trouble, and when I do I can get Powershell to dump the current user name and it's not anything like the user I need it to be for removing to work :-( how the heck can I control which user runs the Powershell code from Jenkins?

Would very much appreciate any clues.

Niksan

unread,
May 24, 2016, 8:11:36 PM5/24/16
to Jenkins Users
If you're running as a service, change the service settings to run as whichever user you desire. I think it defaults to user 'system' by default.

Stuart Henderson

unread,
May 25, 2016, 7:23:41 PM5/25/16
to Jenkins Users
Hi,
Thank you. That worked as solved the problem. Much appreciated.

Rony Mathew

unread,
Jan 15, 2020, 10:05:57 AM1/15/20
to Jenkins Users
Thank You!! It works.
Reply all
Reply to author
Forward
0 new messages