CoCoineticBack to coinetic.io

Network profile switched to Public? Why Windows does it and how to stop it

After a restart, a Windows Server suddenly shows its domain network as Public, or a home PC calls the home network Public again. Remote Desktop stops answering, file shares disappear, monitoring goes quiet. The cause is almost always the same: Windows decided the network profile again, and decided wrong.

In short
  • Every network gets a profile: Domain, Private or Public. Each profile has its own Windows Firewall rules, so a profile change silently changes which rules apply.
  • The Network Location Awareness service (NlaSvc) decides the profile at every start and network change. If it cannot reach a domain controller in time, or cannot identify the network, the result is Public.
  • Check: Get-NetConnectionProfile. Fix: Set-NetConnectionProfile for Private / Public, or Restart-Service NlaSvc -Force to make Windows detect the domain again.
  • Keep it fixed: repair the cause (DNS, gateway), and lock the profile so it is put back automatically when Windows changes it.

1. What the network profile does

Windows gives every network connection one of three network profiles (also called network location or network category):

ProfileWhen Windows uses itTypical firewall effect
DomainThe computer is in an Active Directory domain and has reached a domain controller over this connection.Rules for management, RDP, file sharing and monitoring usually allowed here.
PrivateA network you trust, such as your home or office LAN, chosen by you or by policy.Network discovery and sharing possible.
PublicEverything else, and every network Windows cannot identify.The strictest set: the computer hides from the network, many inbound rules do not apply.

The Windows Firewall has one set of settings and rules per profile. A rule that is enabled only for Domain does not apply when the network is Public. That is why a profile change feels like an outage: nothing was blocked on purpose, the rules simply stopped applying.

The opposite happens too: a laptop that treats the hotel Wi-Fi as Private shows itself and its shares to everyone on it. See Is public Wi-Fi safe?

2. Check the profile

Get-NetConnectionProfile | Select-Object InterfaceAlias, Name, NetworkCategory, IPv4Connectivity

NetworkCategory is DomainAuthenticated, Private or Public. A domain member Server should show DomainAuthenticated on its LAN connection. In the Windows Firewall console, the active profile is marked on the overview page.

When did it change? The event log Applications and Services Logs › Microsoft › Windows › NetworkProfile › Operational records each connection to a network with the category Windows chose.

3. Why Windows picks Public

4. Fix it

Private or Public: set it directly

Set-NetConnectionProfile -InterfaceAlias "Ethernet" -NetworkCategory Private

Run it in an elevated PowerShell; replace Ethernet with the InterfaceAlias from Get-NetConnectionProfile. On Windows 10 and 11 the same is in Settings › Network & internet › the connection › Network profile type.

Domain: let Windows detect it again

Set-NetConnectionProfile cannot set DomainAuthenticated: Windows only grants the Domain profile after it has reached a domain controller. Make it try again:

Restart-Service NlaSvc -Force
Get-NetConnectionProfile

If it stays Public, find out why the domain controller is not reachable:

Get-DnsClientServerAddress -AddressFamily IPv4   # only the domain's DNS servers?
nltest /dsgetdc:your.domain                       # is a domain controller found?
Test-ComputerSecureChannel                        # is the trust with the domain OK?

Unidentified networks

If a connection has no gateway on purpose (a storage, backup or cluster network), give it a gateway only if it really has one; otherwise decide what unidentified networks should be: Local Security Policy (secpol.msc) or Group Policy › Computer Configuration › Windows Settings › Security Settings › Network List Manager Policies › Unidentified Networks › Location type. Choose Private only for Servers whose unidentified networks are all internal.

Firewall rules that depend on one profile

Rules that must work whatever the profile, for example RDP restricted to your admin network, can be enabled for all profiles and limited by remote address. A rule scoped by address is safer than a rule that relies on the profile being right.

5. Keep it from happening again

Fixing the profile once is easy; the problem is that it comes back after the next restart or network change, and nobody notices until something stops working. Check the profile after every restart, or let a tool watch it.

Coinetic AI Security has a network profile lock, in every plan:

And the rest of the network side: open ports with the program behind them, a security check with fixes you can undo, automatic bans of password guessers and port scanners, and an alert when something switches the firewall off. See the Windows Server hardening checklist.

Protect this Server or PC in 5 minutes

Download Coinetic, install, done: it starts protecting at once. 30 days free with all features, no payment details. From $20 per computer per year.

Start the free 30-day trial →

More guides: all Coinetic guides.

Frequently asked

Why does my domain network show as Public after a restart?

Network Location Awareness tried to reach a domain controller before the network, DNS or the domain controller itself was ready, and fell back to Public. Restart the service with Restart-Service NlaSvc -Force and check that the computer uses only the domain's DNS servers.

Can I set a network to Domain with PowerShell?

No. Set-NetConnectionProfile sets only Private or Public. Windows grants the Domain profile itself, after it has reached a domain controller over that connection.

Is Public or Private safer?

Public is stricter: the computer hides from the network and fewer inbound rules apply. Use Private only for networks you trust, such as your home or office LAN.

What is an unidentified network?

A connection Windows cannot recognise, usually because it has no default gateway. Windows puts it on Public unless the Unidentified Networks policy says otherwise.

Where does Windows store the network profiles?

In the registry under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles, one key per known network; the value Category is 0 for Public, 1 for Private and 2 for Domain. Use the PowerShell commands above rather than editing it.