Get-NetFirewallRule
CautionWindows Firewall rules
Get-NetFirewallRule -DisplayName '*remote*'
Queries/creates firewall rules (netsh advfirewall's successor) — the proper way to audit and open ports.
Examples
New-NetFirewallRule -DisplayName 'App 8080' -Direction Inbound -LocalPort 8080 -Protocol TCP -Action AllowOpen inbound 8080
Syntax
Get-NetFirewallRule [-Enabled True] / New-NetFirewallRule -DisplayName n -Direction Inbound -LocalPort p -Protocol TCP -Action Allow
Before you run it
Open only what's necessary.
Related commands
- netshNetwork shell
- firewall-cmdManage firewalld (RHEL)
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store