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
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
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