Windows sometimes incorrectly identifies a network as "Public," blocking crucial services like RDP or file sharing. This command forces it to "Private" without using the GUI.

The Fix

Get-NetConnectionProfile | Where-Object {$_.NetworkCategory -eq 'Public'} | Set-NetConnectionProfile -NetworkCategory Private

Why it works

  • This PowerShell command identifies all currently active network connections classified as Public and reconfigures them to Private.

Verify

Get-NetConnectionProfile | Select-Object Name, NetworkCategory
  • The output should show your active network connection(s) as Private.

Notes

  • Requires Administrator privileges.
  • If you have multiple public networks, it will change all of them. Target a specific InterfaceAlias if needed.

Techworks Blog