how to list, by command line, firewall rules filter by...

Ale Madama 281 Reputation points
2021-03-22T10:46:47.597+00:00

Hi all,
I would like to use "netsh advfirewall firewall" commands, to list only some rule

for example, filter by:

only blocked rules
only rules belonging to a certain group name

more, if possible, list only rule having name starting with "blabla", then I guess using wildcards...

thanks!

Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,917 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 85,546 Reputation points
    2021-03-22T11:41:29.4+00:00

    You can use findstr to filter names but it is simpler with PowerShell

    For example, a test with some filters :

    Show-NetFirewallRule | where {$_.DisplayName -Like "*Test*" -AND $_.Action -eq 'Block' -AND $_.Direction -eq "Inbound"} | select DisplayName
    
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ale Madama 281 Reputation points
    2021-03-22T12:58:19.07+00:00

    excellent castorix, thank you!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.