PowerTip: Use PowerShell to List Firewall Rules

Doctor 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’ }

1 comment

Discussion is closed. Login to edit/delete existing comments.

  • Derek Lowen 0

    Or easier just, Get-NetFirewallRule -Direction Inbound

Feedback usabilla icon