Restore-FirewallRules

1.0.0

Uses the built-in "netsh advfirewall import", the same as "Import Policy..." in the Windows Firewall console.

IMPORTANT: an import REPLACES all local firewall rules and profile settings with those in the file. Rules that
are not in the file are gone afterwards. Rules from Group Policy are not affected.

Before importing, the script saves the current state with Backup
Uses the built-in "netsh advfirewall import", the same as "Import Policy..." in the Windows Firewall console.

IMPORTANT: an import REPLACES all local firewall rules and profile settings with those in the file. Rules that
are not in the file are gone afterwards. Rules from Group Policy are not affected.

Before importing, the script saves the current state with Backup-FirewallRules.ps1 logic (netsh export) next
to the file you restore, so you can go back. It asks for confirmation unless you add -Confirm:$false.

Run it as administrator. Do not run it over a remote session whose connection depends on a rule that the
backup does not contain.

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name Restore-FirewallRules

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 Coinetic AI Security - https://coinetic.io. MIT licence.

Package Details

Author(s)

  • Coinetic AI Security - https://coinetic.io

Tags

Coinetic Windows WindowsServer Firewall WindowsFirewall FirewallManager Restore Import Rules

Dependencies

This script has no dependencies.

Release Notes

1.0.0: restores a .wfw backup; backs up the current rules first; asks before it replaces anything.

FileList

Version History

Version Downloads Last updated
1.0.0 (current version) 9 12/5/2026