Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a Windows firewall rule with a custom group name?

I know I can use netsh advfirewall firewall add rule or wf.msc to create new firewall rules; but when I create a rule this way, it will NOT have a groupName and thus I can't manage multiple rules at the same time.

Is there a way to specify a groupName for some firewall rules?

like image 817
Achilles Avatar asked Aug 14 '12 16:08

Achilles


People also ask

How do I create a group in firewall?

of the firewall rule that you wish to add to a new firewall group and click New Group. Enter a name for the new firewall group and click Move. This action will create the new firewall group with the chosen firewall contained within it.

Can Windows Firewall be configured with group policy?

In a domain environment, administrator can centrally configure Windows Firewall rule using Group Policy. This way, the rules will be automatically applied to all targeted computers in the domain and therefore increasing the security.

How do I change group policy firewall settings?

Go to Computer Configuration -> Policies -> Administrative Templates -> Network -> Network Connections -> Windows Defender Profile -> Domain Profile and open the Windows Defender Firewall: Define inbound port exceptions policy. Here you can create a list of firewall rules with simple text strings.


1 Answers

The following Powershell one-liner adds/renames Group name for the rules with DisplayName='GTA V'. Works for Windows 8+

Get-NetFirewallRule -DisplayName 'GTA V' | ForEach { $_.Group = 'games'; Set-NetFirewallRule -InputObject $_ }

like image 135
maoizm Avatar answered Sep 25 '22 02:09

maoizm