136k views
2 votes
Display a list only of inbound Windows Firewall rules

User Arxisos
by
8.0k points

1 Answer

6 votes

Final answer:

To see a list of inbound Windows Firewall rules, use the Windows Firewall with Advanced Security interface or the 'Netsh' command-line tool by entering 'netsh advfirewall firewall show rule name=all dir=in' in Command Prompt with admin rights.

Step-by-step explanation:

To display a list of only inbound Windows Firewall rules, you can use the Get-NetFirewallRule PowerShell cmdlet along with filtering based on the Direction property. The Direction property specifies whether the rule is for inbound or outbound traffic. Here's a one-liner PowerShell command to achieve this:

Get-NetFirewallRule | Where-Object {$_.Direction -eq 'Inbound'} | Format-Table -Property DisplayName, Action, Direction, Enabled -AutoSize

This command retrieves all firewall rules using Get-NetFirewallRule, filters them using Where-Object to include only inbound rules, and then formats and displays specific properties like DisplayName, Action, Direction, and Enabled in a table using Format-Table. Adjust the displayed properties as needed.

Executing this command in a PowerShell environment will provide you with a concise list of inbound firewall rules, including their display name, action (allow or block), direction (inbound), and whether they are enabled or not.

Remember to run PowerShell with administrative privileges to ensure access to firewall rule information.

User Avck
by
7.3k points