我有一个我创建的脚本,它在本地工作正常,没有错误 . 我正在使用powershell脚本来提取所有Active Directory用户 . 当我在Jenkins服务器上运行作业时,它失败了 . 从服务器运行的是Windows 2012 Server,Master是Linux .

这是我收到的错误消息:

PowerShell脚本] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass“&'C:\ Users \ Jenkins $ \ AppData \ Local \ Temp \ jenkins275111606630255654.ps1'”Get-ADUser:无法联系服务器 . 这可能是因为此服务器不存在,当前已关闭,或者它没有运行Active Directory Web服务 . 在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

服务器正在运行Active Directory Web服务,服务器已启动并且运行从属服务器可以与活动目录服务器通信 . 我在这篇文章中删除了一些域凭据 . 我为powershell安装了插件 .