1

我正在使用厨师服务器11.04和厨师客户端11.12.4-1的Windows Server 2012 r2我试图执行活动目录在Windows客户端上的PowerShell cmds。例如:当我使用厨师食谱使用刀引导失败,但成功使用厨师客户端在Windows目标节点

刀引导窗口WinRM的10.XX.XXX.XX -x用户名-p XXXXXXX -r Adpowershell

*刀WinRM的“名配方执行失败。 co“in”“chef-client -r Adpowershell”-x username -P xxxxxxx

错误是无法联系服务器。这可能是因为此服务器不存在,它当前处于关闭状态,或者它没有运行的Active Directory Web服务。

刀命令成功比活动目录powerwshell CMDS

但是当我尝试用厨师的客户端本地节点其配方成功执行以外的其他的PowerShell CMDS。

我已经提到有关此unable to contact server的各种链接。但无法找到Windows 2012 R2的任何解决方案。 谁能告诉我这个问题

+0

我不能给出一个最终的答案,但我怀疑这是由于凭据重播(又名CredSSP身份在Windows的文档)。 [有关这里的一些文档](https://msdn.microsoft.com/en-us/library/ee309365(v = vs.85).aspx) – Tensibai

回答

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