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

Viewed 10521

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?

4 Answers
$rule = Get-NetFirewallRule -Name 'nameme'; $rule.Group = 'nameme'; $rule | Set-NetFirewallRule; 
netsh advfirewall firewall show rule name=nameme
netsh advfirewall set allprofiles state on
netsh advfirewall set allgroups on
netsh advfirewall firewall add rule name="nameme" dir=out action=Allow
netsh advfirewall export "C:\temp\WFconfiguration.wfw"
netsh advfirewall import "C:\temp\WFconfiguration.wfw"

NOTE: you must first create the rule name in Windows firewall, then change nameme to the name run PowerShell administrator.

For the group name= any

Screenshot

Managing Windows Firewall is now easier than ever Just go download it

Related