Change a Network from Public to Private with PowerShell
Switch the network profile of any adapter between Public and Private using Set-NetConnectionProfile so sharing rules follow.
01Command
$ Set-NetConnectionProfile -InterfaceAlias "Wi-Fi" -NetworkCategory Private02What it does
Windows applies different firewall rules depending on whether a network is Public (untrusted — sharing and discovery blocked) or Private (trusted — sharing allowed). When a network is misdetected as Public, your PC won't appear in other devices' network lists and shared folders/printers stop working. Set-NetConnectionProfile flips the category for a named adapter instantly, no reboot needed. Get-NetConnectionProfile shows the current category and the exact -InterfaceAlias names.
03Risk
04Undo
$ Set-NetConnectionProfile -InterfaceAlias "Wi-Fi" -NetworkCategory Public05Sources
- Set-NetConnectionProfileEvidence: Set-NetConnectionProfile changes NetworkCategory between Public, Private (and DomainAuthenticated) for the adapter named by -InterfaceAlias.
Last verified: 2026-09-18 · Category: System & Settings
06Related solutions
Enumerate every wireless network Windows remembers, inspect a profile's settings, and export profiles for backup or transfer to another PC.
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.