3

I'm using the following command to list firewall rules

netsh advfirewall firewall show rule dir=in name=all

How can I display enabled rules only? There's no switch like enabled=true

daisy
  • 747
  • 4
  • 13
  • 28

2 Answers2

3

netsh advfirewall is not recommended anymore and might be deprecated in future versions of Windows (see the warning message when you enter netsh advfirewall).

Additionally, I'm not aware of an "enabled" switch in netsh advfirewall firewall

I suggest you use Powershell to get the list of enabled inbound rules :

Get-NetFirewallRule -Direction Inbound -Enabled True
Swisstone
  • 6,357
  • 7
  • 21
  • 32
2

I think this Powershell command might be useful in your case:

netsh advfirewall firewall show rule dir=in name=all | Select-String -Pattern 'Yes' -Exclude "Edge traversal" -AllMatches -Context 2,11
Fsoc
  • 83
  • 4