How do I force Windows 10 to see a network as private?
I think that the easiest method to change your network to Private is through the Registry Editor:
- Do a search for regedit, then right-click and Run as administrator
- If necessary, acknowledge the UAC prompt
Navigate to the following location:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles
Expand the Profiles key and navigate through each GUID key below that, noting the corresponding ProfileName on the right:
When you find the ProfileName of the network you want to change to Private, double-click on the Category DWORD on the right-hand side:
Change the ‘Value data’ from 0 (Public) to 1 (Private):
Close the Registry Editor
- Reboot
(Source: How to Set Network Location to be Public or Private in Windows 10)
The following small PowerShell script can do the same (it also requires administrator privileges).
It will list all non-private profiles and ask for confirmation to change them to private.
## Change NetWorkConnection Category to Private
#Requires -RunasAdministrator
Get-NetConnectionProfile |
Where{ $_.NetWorkCategory -ne 'Private'} |
ForEach {
$_
$_|Set-NetConnectionProfile -NetWorkCategory Private -Confirm
}
Sample output on my German locale system:
Name : Netzwerk
InterfaceAlias : Ethernet
InterfaceIndex : 3
NetworkCategory : Public
IPv4Connectivity : Internet
IPv6Connectivity : Internet
Bestätigung
Möchten Sie diese Aktion wirklich ausführen?
[J] Ja [A] Ja, alle [N] Nein [K] Nein, keine [H] Anhalten [?] Hilfe (Standard ist "J"): K
Edit This is the English confirmation text:
Confirm
Are you sure you want to perform this action?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): n
You could use a Powershell command to perform this:
- WIN+R
- Type
powershell.exe
and hit Ctrl+Shift+Enter (Opens as Administrator) - Paste in the following command (replacing
Network_Name
with the chosen network)
Set-NetConnectionProfile -Name "Network_Name" -NetworkCategory Private