【问题标题】:Fix "Unable to check the status of the firewall" of `Set-WSManQuickConfig`修复 `Set-WSManQuickConfig` 的“无法检查防火墙状态”
【发布时间】:2020-07-15 00:21:41
【问题描述】:

为什么Enable-PSRemoting/Set-WSManQuickConfig在Windows 2012R2、Azure WebRole的Administrator下无法“检查防火墙状态”?如何解决这个问题?

PS D:\Users\***User> enable-psremoting -force

WinRM is already set up to receive requests on this computer.
Set-WSManQuickConfig : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2"
Machine="localhost"><f:Message><f:ProviderFault provider="Config provider"
path="%systemroot%\system32\WsmSvc.dll"><f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault"
Code="2" Machine="RD***CA2"><f:Message>Unable to check the status of the firewall.
</f:Message></f:WSManFault></f:ProviderFault></f:Message></f:WSManFault>
At line:69 char:17
+                 Set-WSManQuickConfig -force
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Set-WSManQuickConfig], InvalidOperationException
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand

操作系统名称:Microsoft Windows Server 2012 R2 Datacenter。操作系统版本:6.3.9600 N/A Build 9600。Powershell:4.0

PS。 是的,有:

更新。 其他有价值的参考:

【问题讨论】:

    标签: powershell azure


    【解决方案1】:

    在我的情况下,运行此帮助(手动创建防火墙规则):

    netsh advfirewall firewall add rule name="Windows Remote Management (HTTP-In)" dir=in action=allow service=any enable=yes profile=any localport=5985 protocol=tcp
    

    取自http://www.davidaiken.com/2011/01/12/enable-powershell-remoting-on-windows-azure/

    【讨论】:

      【解决方案2】:

      我尝试启用 winrm 进行 ansible 测试,但没有任何帮助,规则已经到位。将 Windows 显示语言从捷克语更改为英语解决了我的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-11-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多