1

我正在为 windows server 2012 r2 使用 Chef-server-11.04 和 chef-client 11.12.4-1。我正在尝试在 windows 客户端上执行 Active Directory powershell cmds。我使用时配方执行失败

刀引导 windows winrm 10.XX.XXX.XX -x 用户名 -P xxxxxxx -r Adpowershell

或者

*knife winrm "name:example.co.in" "chef-client -r Adpowershell" -x 用户名 -P xxxxxxx

错误是无法联系服务器。这可能是因为此服务器不存在、当前已关闭或没有运行 Active Directory Web 服务

对于 Active directory powerwshell cmds 以外的其他 powershell cmds,knife 命令是成功的

但是当我在节点上本地使用 chef-client 尝试它时,配方成功执行。

我已经参考了有关此无法联系服务器的各种链接。但找不到任何适用于 Windows 2012 r2 的解决方案。谁能告诉我这个问题的解决方案

4

1 回答 1

0

在您的服务器上运行:

winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
netsh advfirewall firewall add rule name="WinRM 5985" protocol=TCP dir=in localport=5985 action=allow
netsh advfirewall firewall add rule name="WinRM 5986" protocol=TCP dir=in localport=5986 action=allow  
于 2015-05-08T15:00:59.320 回答