Running Powershell Script fails on Jenkins Server

时间:2017-09-28 21:47:47

标签: powershell jenkins

I have a script that I created and it works fine locally with no errors. I'm using a powershell script to pull all the Active Directory Users. When I run the job on the Jenkins Server it fails. The slave server is running Windows 2012 Server and the Master is Linux.

This is the error message that I am getting:

PowerShell Script] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 'C:\Users\Jenkins$\AppData\Local\Temp\jenkins275111606630255654.ps1'" Get-ADUser : Unable to contact the server. This may be because this server does not exist, it is currently down, or it does not have the Active Directory Web Services running.

At C:\Users\Jenkins$\AppData\Local\Temp\jenkins275111606630255654.ps1:1 char:1 + Get-ADUser -Filter * -SearchBase "dc=,dc=com" -properties *|Select-Object N ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (:) [Get-ADUser], ADServerDownException + FullyQualifiedErrorId : ActiveDirectoryServer:0,Microsoft.ActiveDirectory.Management.Commands.GetADU

The server is running Active Directory Web Services the server is up and running the slave can talk to the active directory server. I removed some of the domain credentials in this post. I have the plugin installed for powershell.

0 个答案:

没有答案