微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 jenkins 管道中运行 winrm 时出错

如何解决在 jenkins 管道中运行 winrm 时出错

Connecting to Remote Server 172.18.32.39 Failed with the following error message : The WinRM client 
14:53:09  cannot process the request. Default authentication may be used with an IP address under the following conditions: the 
14:53:09  transport is HTTPS or the destination is in the TrustedHosts list,and explicit credentials are provided. Use 
14:53:09  winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more 
14:53:09  information on how to set TrustedHosts run the following command: winrm help config. For more information,see the 
14:53:09  about_Remote_Troubleshooting Help topic.

从我的构建节点针对我的测试节点调用 test-wsman 命令时,我收到上述 winrm 错误。当我从构建节点对测试节点手动运行 test-wsman 命令时,它可以工作。我想除了那个奇怪之外,有没有人成功解决了上述错误?有什么办法可以从 winrm 获得更多输出解决这个问题?

解决方法

将主机添加到 TrustedHosts

您能否在运行管道的节点上的 Powershell 中运行以下命令

winrm quickconfig
winrm set winrm/config/client @{TrustedHosts="172.18.32.39”}

然后尝试再次运行管道。另外,当 test-wsman cmdlet 通过管道运行时,您能否验证您正在从运行它的同一用户运行 test-wsman cmdlet?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。