3

I setup a couple of Outbound Rules in Windows 10 Defender Firewall on one PC. I like to copy these rules to another PC. The rules block a couple of programs from accessing the internet. These programs are installed in the same directories on both PCs and it should be a 1:1 copy.

How can I copy or export/import those firewall rules?

What I tried already:

There is a function "Export List" which exports the rules to a text file. But I did not see any corresponding Import list function.

There are also functions on the root level in the menu Action to export and import policies. But it seems that exports and imports everything and this is not what I want.

Edgar
  • 381
  • 3
  • 17
  • 1
    Have you tried using the PowerShell cmdlet get-netfirewallrule and then a matching set-netfirewallrule? I haven't used these together myself and won't be able to test this out for a day or so, but it should work with a simple filter. – music2myear Nov 14 '19 at 04:50
  • 1
    @music2myear: Thanks, I just googled them and I also found Copy-NetFirewallRule It seems all of them are not designed to copy rules from one PC to another. Maybe it's possible to work with them to do this. But at least for me it does not make sense to spend hours with this when I use it only (likely) one time. – Edgar Nov 14 '19 at 05:03
  • 1
    You export (get) the rule on one computer and import it on the other. I'm not sure what you mean when you say it doesn't make sense to spend hours working on this. If you are just doing this once, just manually create the rules on the second computer. – music2myear Nov 14 '19 at 05:31
  • 2
    Similar question here with an answer down the page>>>>>>https://superuser.com/questions/589855/import-export-specific-windows-firewall-rule – Moab Nov 14 '19 at 12:38
  • @Moab: Thanks for your comment. I added this in an answer to make it easy for other users to follow the steps. If you want feel free to add an answer yourself. – Edgar Nov 15 '19 at 03:10

1 Answers1

2

Based on the comment from @Moab and this answer to another question

Import Export specific Windows Firewall Rule

I exported the following registry keys on the source PC.

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules

This exported all rules. Then I edited that file in notepad to keep only the entries which I wanted to transfer. And then I added them to the registry of the destination PC.

All done, it works.

Edgar
  • 381
  • 3
  • 17