Windows Firewall

Exporting Windows Firewall

Using WFW

To export all Windows Firewall rules:

Using Registry

Alternatively, export the following registry entry:

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

Using MMC

MMC can export any table shown as CSV.

NOTE: Because the export doesn't delimit ",", it's best not to choose "CSV" for the export. However if you have the CSV then you can find-replace ", " with "; " to quickly fix the issue.

Using Powershell

Powershell can be well, powerful, but with power comes great responsibility (and way too much information):

Import-Module -Name 'NetSecurity'

Get-NetFirewallRule | Export-Csv -Path .\firewall.csv -Delimiter ';' 

Using Netsh

While it is easy to create new rules in netsh, it is not possible to list all the firewall rules in netsh. You can only import and export .wfw files. This means you're better off usually using the MMC GUI to import and export.