Your cart is currently empty!
How to export and import individual firewall rules on Windows 11
Windows Defender Firewall is your PC’s frontline defense. Sometimes, you need to move custom firewall rules from one machine to another—maybe you’re setting up a new device or sharing configurations with a teammate. But Windows 11 doesn’t have a one-click way to export and import just one rule through the usual interface. Don’t worry. You can do it easily with PowerShell.
Here’s how.
Why Export or Import Firewall Rules?
- Backup: Save your custom settings before making big changes or reinstalling Windows.
- Migration: Move your carefully tuned rules to a new computer.
- Sharing: Quickly hand off a specific rule to a colleague.
Exporting a Firewall Rule
Let’s say you want to export a rule named “Allow Custom App.”
1. Open PowerShell as Administrator
- Press
Win + X
, then choose Windows Terminal (Admin) or PowerShell (Admin).
2. Find the Exact Rule Name
Type:
Get-NetFirewallRule | Select-Object DisplayName
Scroll through the list and find the rule you want.
3. Export the Rule to a File
Replace "Allow Custom App"
with your actual rule name:
Export-NetFirewallRule -DisplayName "Allow Custom App" -FilePath "C:\Temp\CustomAppRule.wfw"
- Change the path as needed.
- The
.wfw
file contains your exported rule.
Importing a Firewall Rule
1. Copy the .wfw
File to the New PC
Move the file to the target computer (USB, cloud, network—your call).
2. Open PowerShell as Administrator
Same as before: Win + X
> Windows Terminal (Admin).
3. Import the Rule
Import-NetFirewallRule -FilePath "C:\Temp\CustomAppRule.wfw"
Done. The rule is now on the new system.
Tips & Troubleshooting
- If you’re managing a lot of rules, use wildcards or export several at once:
Get-NetFirewallRule -DisplayName "*Custom*" | Export-NetFirewallRule -FilePath "C:\Temp\CustomRules.wfw"
- Double-check the rule after import: open Windows Defender Firewall with Advanced Security and make sure it’s listed.
- If you get an error, ensure you’re running PowerShell as admin.
Wrapping Up
Windows 11 doesn’t make exporting or importing individual firewall rules obvious, but PowerShell gets it done with just a couple of commands. This is the fastest, most reliable way to move your rules where you need them.
If you have questions or need help with more advanced firewall configurations, drop a comment below.
Need visuals or a printable cheatsheet? Let me know and I’ll add them!
Tech enthusiast and content creator passionate about making technology simple for everyone. I share practical tips, guides, and reviews on the latest in computers, software, and gadgets. Let’s explore the digital world together!