Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fix "Unable to check the status of the firewall" of `Set-WSManQuickConfig`

Why Enable-PSRemoting/Set-WSManQuickConfig can not "check the status of the firewall" running under Administrator on Windows 2012R2, Azure WebRole? How to fix this?

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

OS Name: Microsoft Windows Server 2012 R2 Datacenter. OS Version: 6.3.9600 N/A Build 9600. Powershell: 4.0

PS. Yes, there are:

  • Error PSRemoting using Session and CredSSP. No clear solution
  • Winrm quick config shows error . Rebooting/reimaging the instance does not help.
  • https://support.microsoft.com/en-us/kb/2697738. Hotfix (2012 year!) is not installed but then it needs installed each deployment?
  • https://technet.microsoft.com/en-us/library/hh849694.aspx. Has this message but that is for "client versions"
  • http://terenceluk.blogspot.ru/2012/05/executing-command-winrm-quickconfig.html Restarting firewall does not help
  • How to enable powershell remoting in Powershell V3?. No "HKLM:\SYSTEM\Policies\Microsoft\Windows Firewall" to change. restarting firewall service does not help.

Update. Other valuable refs:

  • http://www.thomasmaurer.ch/2011/01/quick-powershell-remoting-guide/
  • http://www.davidaiken.com/2011/01/12/enable-powershell-remoting-on-windows-azure/
  • Get-Help about_Remote_Troubleshooting
like image 449
Artyom Avatar asked Sep 20 '16 11:09

Artyom


2 Answers

In my case running this helped (manually creates the firewall rule):

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

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

like image 69
Artyom Avatar answered Nov 15 '22 05:11

Artyom


I tried to enable winrm for ansible testing, nothing helped, the rules were in place. Changing the Windows display language from czech to english fixed my problem.

like image 21
Jozef Avatar answered Nov 15 '22 05:11

Jozef