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.

WindowsnetworksecuritypowershellLow risk
Run Set-NetConnectionProfile -InterfaceAlias "Wi-Fi" -NetworkCategory Private in an admin PowerShell; check first with Get-NetConnectionProfile.

01Command

Command
$ Set-NetConnectionProfile -InterfaceAlias "Wi-Fi" -NetworkCategory Private

02What 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

RiskLow risk
RequirementsRun PowerShell as administrator. Check the current profile with Get-NetConnectionProfile.
!Warning: Only set Private on networks you trust (your home/office). Leaving a coffee-shop or hotel hotspot as Public is the safe default — Public is stricter on purpose.

04Undo

Undo
$ Set-NetConnectionProfile -InterfaceAlias "Wi-Fi" -NetworkCategory Public

05Sources

  • Set-NetConnectionProfile
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: 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