From an elevated PowerShell window issue the following command to gather some information about our current network profile:
Get-NetConnectionProfile Name : Unidentified Network InterfaceAlias : Ethernet InterfaceIndex : 10 NetworkCategory : Public IPv4Connectivity : LocalNetwork IPv6Connectivity : LocalNetwork
The only information we really need from this output is the “InterfaceIndex”
After getting the InterfaceIndex, we run the following command:
Set-NetConnectionProfile -InterfaceIndex 10 -NetworkCategory PrivateThe last argument is what category you want to switch it to. The only allowed values here are “Public” or “Private” as per the MSDN documentation. The category can also be “DomainAuthenticated” but Windows will automatically assign this when the machine is added to a domain.