Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Firewall state different between Powershell output and GUI

When I run Get-NetFirewallProfile I see that the Domain profile Enabled is set to True. However, when I go to Control Panel > Windows Firewall the Domain profile is turned off by the GPO. Also, in Windows Firewall with Advanced Settings, the Firewall state is "Off".

I'm not sure why the powershell output is different than the GUI. Please help!

Thanks, aB

like image 775
AlexB Avatar asked Jun 25 '15 18:06

AlexB


People also ask

How do I check firewall status PowerShell?

To get the current status of Windows Firewall using PowerShell, just type Get-NetFirewallProfile in the PowerShell window and press Enter. You'll be shown a list of all the network profiles, whether Windows Firewall is enabled for each profile and information about various other Windows Firewall settings.

What PowerShell syntax would you use to configure Windows Firewall rules?

The New-NetFirewallRule cmdlet creates an inbound or outbound firewall rule and adds the rule to the target computer. Some parameters are used to specify the conditions that must be matched for the rule to apply, such as the LocalAddress and RemoteAddress parameters.

How enable Windows Firewall PowerShell?

In Powershell, you can easily enable or disable Windows Firewall using the Set-NetFirewallProfile command. This cmdlet is used to configure the Firewall's advanced security settings for a particular, or all, network profile.


1 Answers

According to this article: https://social.technet.microsoft.com/Forums/windowsserver/en-US/4d8678e2-5653-4fd2-b275-62e0e7008ff9/conflicting-display-of-windows-firewall-setting-from-gui-and-netsh-advfirewall?forum=winserverGP

There are 2 stores for this setting, a local and a Group Policy store. A resulting firewall state is calculated based on these 2.

The answer from Elytis Cheng:

Windows Firewall has mutliple configuration stores. One is for Group Policy and one is for local. The policy that is actually applied is a result of a merge of these stores (how they are merged depends on what options are set in Group Policy). In Group Policy, the firewall was enabled for the domain profile. However, in the local store, the firewall was disabled for the domain profile. The merge result meant that the firewall was on. This is shown correctly by the Control Panel (which shows the active policy, not policy from a specific store). At the time, the Windows Firewall with Advanced Security snap-in connected to the local computer was showing the local store.

The final piece is netsh. netsh firewall show allprofiles shows the configuration in the local store.

like image 191
Erik Oppedijk Avatar answered Sep 19 '22 00:09

Erik Oppedijk