Does your firewall rules look like this? Some rules applies to all profiles and some to some others?
If you need to streamline the rules to just apply to one profile, PowerShell is your friend here!
Use the following PowerShell command to list all the rules that are enabled
Get-NetFirewallRule -Enabled True
To change a profile for a specific rule the command for this is
Set-NetFirewallRule -Name “Rule Name” -Profile “Private,Domain”
But what about changing all of them? Easy just type and it will enumerate all your enabled rules and apply only to Domain profile
Get-NetFirewallRule -Enabled True | Set-NetFirewallRule -Profile Domain
Hello, thanks for this post.
If I want to bulk change the profile type of enabled rules to “All” instead of “Domain” or “Private”, what would be the command?
Also, iIs there a way to get/select all enabled rules with a certain action (for example “Block” or “Allow”) and then bulk change their profile type to “All”?
Thank you so much in advance!!
LikeLike
Hi there!
I think you are looking for the PS command
Get-NetFirewallRule -Enabled True | Set-NetFirewallRule -Profile Any
this will change the profile to Any for all enabled FW rules
LikeLike