You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
new-netfirewallrule
About this tag
The New-NetFirewallRule PowerShell cmdlet is a core tool for managing Windows Server firewall rules. It allows administrators to open specific ports programmatically, which is essential for routine server configuration. A single misconfiguration can expose services to the public internet, so using New-NetFirewallRule correctly is critical for security. The cmdlet is used in conjunction with the Windows Defender Firewall with Advanced Security console (wf.msc) to create inbound or outbound rules. Best practices include opening only necessary ports and verifying rules against official Microsoft guidance. This tag covers secure port opening methods, common pitfalls, and community-tested commands for Windows Server environments.
If you manage servers, opening a port in the Windows Server firewall is one of those routine tasks that’s trivial to execute but easy to get wrong — and a single misconfiguration can expose services to the public internet. This feature explains the exact, supported ways to open ports in Windows...
gpo
group policy
inbound rules
ipsec
localsubnet
network security
network testing
new-netfirewallrule
port rules
powershell
privilege
remoteaddress
rule management
security best practices
urlacl
wf.msc
wfas
windows defender firewall
windows server