09 May 2023

Manage Windows Firewall rules with PowerShell and Command Prompt

Display firewall rules that contain the word 'zebra' using PowerShell:

Show-NetFirewallRule | where {$_.DisplayName -Like "*zebra*"} | select DisplayName

Remove a firewall rule using PowerShell:

Remove-NetFirewallRule -DisplayName "Zebra Application"

Add a firewall rule using Command Prompt:

netsh advfirewall firewall add rule name="Zebra Application" dir=in action=allow protocol=TCP program="C:\program files (x86)\zebra\application.exe" profile=any enable=yes

No comments:

Post a Comment