Use this when the wrong firewall profile applies.
Firewall Profiles
Windows Firewall has three profiles — Domain, Private and Public — chosen by Network Location Awareness for each network. Each has its own default actions and rules; Public should be strictest.
1. Get-NetConnectionProfile — which profile is active.
2. Domain/Private/Public each have their own rules.
3. Rule enabled in the active profile?
4. Fix the profile (NLA) rather than opening Public.
5. Verify.
network category → firewall profile → its rules
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Get-NetFirewallProfilePrimary Commands
Configuration and operational commands for this Topic.
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 Commands Verify boundary
Get-NetConnectionProfile
Set-NetConnectionProfile -InterfaceAlias Ethernet -NetworkCategory Private
Domain cannot be set manually; fix DNS or DC reachability instead.
Step 2 Common mistakes Narrow the fault
- Servers stuck on Public because NLA could not reach a DC at boot — restart the NlaSvc or fix DNS.
- Network Location Awareness picks the profile.
- Public should be the strictest.
- Domain profile needs a reachable DC.
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
How it works
Network Location Awareness (NLA, service NlaSvc) classifies each connection. If it can authenticate to a domain controller of the computer's domain, the connection becomes Domain; otherwise it gets the category the user or policy chose (Private or Public). The firewall profile follows that category, so the wrong category means the wrong set of rules.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
See which profile each adapter is in, and why
PS C:\> Get-NetConnectionProfile | Select InterfaceAlias, Name, NetworkCategory, IPv4Connectivity
InterfaceAlias Name NetworkCategory IPv4Connectivity
-------------- ---- --------------- ----------------
Ethernet corp.example.com DomainAuthenticated Internet
vEthernet (Lab) Unidentified network Public LocalNetwork
PS C:\> Get-NetFirewallProfile | Select Name, Enabled, DefaultInboundAction, DefaultOutboundAction, LogFileName
DomainAuthenticated appears only when NLA could reach and authenticate to a DC of the computer's domain through that adapter. Each adapter is categorised separately: a server can be Domain on its LAN NIC and Public on a backup or virtual NIC.
Why a server ends up Public
| Cause | Fix |
|---|---|
| NLA ran before the network/DNS was ready at boot | Restart-Service NlaSvc -Force (also restarts dependants); fix DNS order |
| DC not reachable from that adapter | Expected for isolated networks — set Private if appropriate |
| DNS suffix/servers wrong on the adapter | Correct DNS so _ldap._tcp.dc._msdcs resolves |
| Firewall rules exist only for Domain profile | Rules silently do not apply on the other profile |
Rules are profile-specific
Get-NetFirewallRule -DisplayName 'Remote Desktop*' | Select DisplayName, Enabled, Profile
Set-NetFirewallRule -DisplayName 'Remote Desktop - User Mode (TCP-In)' -Profile Domain,Private
A rule enabled only for Domain stops working the moment NLA flips the adapter to Public — a classic cause of "RDP stopped after reboot".
Logging dropped packets per profile
Set-NetFirewallProfile -Name Domain,Private,Public -LogBlocked True -LogMaxSizeKilobytes 16384
Get-Content $env:SystemRoot\System32\LogFiles\Firewall\pfirewall.log -Tail 20
The log shows the profile-independent decision; combine it with the active profile to understand which rule set applied. In Group Policy, set the firewall per profile and avoid local rule merging on servers (AllowLocalFirewallRules = False) so the policy is the single source of truth.
*The Windows Firewall network profile records above are illustrative examples, not captured from a lab or production system.*
Profiles
| Profile | When |
|---|---|
| Domain | Network where a DC is reachable (authenticated) |
| Private | User-marked trusted networks |
| Public | Default for unknown networks |
Check the active profile: Get-NetConnectionProfile.
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 → Firewall Profiles. 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%