Use this when managing Windows Defender Firewall.
Windows Defender Firewall
Windows Defender Firewall is the stateful host firewall in Windows. Manage it with wf.msc, Get-NetFirewallProfile and New-NetFirewallRule, or centrally through Group Policy or Intune.
1. Service running: Get-Service mpssvc.
2. Profiles enabled.
3. GPO-managed rules: Get-NetFirewallRule -PolicyStore ActiveStore.
4. Logging: Set-NetFirewallProfile -LogBlocked True.
5. Review rules.
WFP-based firewall → rules from local and GPO stores → enforcement
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Disabling the firewall to fix connectivity instead of adding a rule.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- The firewall is stateful.
- Rules apply per profile.
- GPO or Intune manages it centrally.
Get-NetFirewallProfile— profiles, enabled, default actions, loggingGet-NetFirewallRule -Enabled True -Direction Inbound— enabled inbound rulesGet-NetFirewallRule -DisplayName '<name>' | Get-NetFirewallPortFilter— ports of a rulenetsh advfirewall monitor show firewall— effective state
ReferenceWhy it matters1 section · depth on demand
Rule processing
Rules are not processed top-down like a router ACL. Windows evaluates: authenticated bypass rules, then block rules, then allow rules, then the profile default. An explicit block therefore wins over any allow rule. Rules from all sources (local, GPO, MDM) are combined into the effective policy, shown in wf.msc → Monitoring.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Windows Defender Firewall is a stateful host firewall with three profiles (Domain, Private, Public) and rules for inbound, outbound and connection security (IPsec).
Get-NetFirewallProfile | ft Name,Enabled,DefaultInboundAction,DefaultOutboundAction,LogFileName,LogAllowed,LogBlocked
Set-NetFirewallProfile -Profile Domain,Private,Public -Enabled True -DefaultInboundAction Block
Set-NetFirewallProfile -All -LogBlocked True -LogMaxSizeKilobytes 16384
Manage rules centrally with GPO or Intune; local rule merging can be disabled ("Apply local firewall rules: No") so only centrally managed rules apply.
Logging
Set-NetFirewallProfile -Profile Domain -LogBlocked True -LogFileName %SystemRoot%\System32\LogFiles\Firewall\pfirewall.log
Documented example, not captured output. Blocked connections also appear in the Security log (event 5157) when WFP auditing is enabled.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Windows Firewall → Windows Defender Firewall. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/ · confidence 94%