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.
01Command
$ Get-NetConnectionProfile | Format-Table Name,InterfaceAlias,NetworkCategory -AutoSize02What 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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Get-NetConnectionProfile | Microsoft LearnEvidence: Microsoft documents Get-NetConnectionProfile as retrieving connection profile data including NetworkCategory (Public, Private, DomainAuthenticated).
Last verified: 2026-09-17 · Category: Network
06Related solutions
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.
The PowerShell-native replacement for netstat: filter connections by state, port, or process and pipe results instead of parsing text.
The modern, scriptable replacement for nslookup: ask for exact record types, hit specific DNS servers, and see TTLs as objects.