Check and change the network profile (Public/Private) on Windows

See which firewall category every connection belongs to with Get-NetConnectionProfile and flip it with Set-NetConnectionProfile.

WindowsnetworkpowershellfirewallLow risk
Run Get-NetConnectionProfile to see each connection's NetworkCategory, and Set-NetConnectionProfile -InterfaceIndex N -NetworkCategory Private to change it.

01Command

Command
$ Get-NetConnectionProfile | Format-Table Name,InterfaceAlias,NetworkCategory -AutoSize

02What it does

This is the cmdlet behind the 'Do you want your PC to be discoverable?' prompt, and Windows silently defaults new networks to Public, which silently blocks inbound connections and file sharing. Get shows the forgotten state; Set-NetConnectionProfile changes it per interface. Because firewall rules are profile-scoped, a rule created only for Private will never fire while the NIC is still Public — a classic invisible failure.

03Risk

RiskLow risk
!Warning: Marking an unknown network Private enables network discovery and softer firewall rules — only do it for networks you control.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Get-NetConnectionProfile | Microsoft Learn
    Microsoft · vendor-doc · 2026-09-17
    Evidence: Microsoft documents Get-NetConnectionProfile as retrieving connection profile data including NetworkCategory (Public, Private, DomainAuthenticated).

Last verified: 2026-09-17 · Category: Network

06Related solutions