PowerTip: Use PowerShell to List Firewall Rules

Doctor Scripto

Dr Scripto

Summary: Use Windows PowerShell to list firewall rules configured in Windows Server 2012 R2.

Hey, Scripting Guy! Question How can I use Windows PowerShell to show the inbound firewall rules in Windows Server 2012 R2 that are enabled?

Hey, Scripting Guy! Answer Use the Get-NetFirewallRule cmdlet to get the entire list, and then
          filter on the Enabled and Direction properties:

Get-NetFirewallRule | Where { $_.Enabled –eq ‘True’ –and $_.Direction –eq ‘Inbound’ }

Doctor Scripto
Dr Scripto

Scripter, PowerShell, vbScript, BAT, CMD

Follow Dr Scripto   

1 comment

Leave a comment