Audit Firewall Rules With Get-NetFirewallRule
List enabled rules and pipe them for review or export.
01Command
$ Get-NetFirewallRule -Enabled True | Select-Object DisplayName, Direction, Action02What it does
The cmdlet returns every rule with direction, action, profile and ports, so you can filter for inbound allow rules or export an audit report. Reviewing a hundred rules in the GUI is tedious; piping them to Where-Object and Export-Csv is not.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Get-NetFirewallRuleEvidence: Retrieves firewall rules and their properties.
Last verified: 2026-10-13 · Category: Security & Privacy
06Related solutions
Enumerate every wireless network Windows remembers, inspect a profile's settings, and export profiles for backup or transfer to another PC.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.
The PowerShell-native replacement for netstat: filter connections by state, port, or process and pipe results instead of parsing text.