Need help to change a Network Location from Public to Private on Windows? We can help you.
As part of our Server Management Services, we assist our customers with several Windows-related queries.
Today, let us focus on the various aspects of network profiles in Windows.
What is a Network Location (Profile) in Windows
Windows network profiles are a part of the Windows Defender Firewall with Advanced Security. It allows to apply different firewall rules depending on the type of network the computer is connected to.
Network profiles first appeared in Vista/Windows Server 2008. In Windows 10, we can assign one of the following network security profiles for NIC (network interface card), whether Ethernet or Wi-Fi:
- Private or Home network – a profile for a trusted network (home or office networks).
In such a network, the computer will be available for discovery by other devices; we can share your files and printers.
- Public network – a profile for an untrusted network (public Wi-Fi network in the subway, cafe, airport).
We do not trust other devices on such a network, the computer will be hidden to other network devices, no one will be able to access shared network folders and printers on the computer.
- Domain network – a profile for computers that are members of an Active Directory domain.
This applies automatically after joining Windows to the AD domain. We can apply domain firewall policies for this profile.
Windows use the Network Location Awareness (NLA) service to determine if a network connection is on a Public, Private, or Domain network.
Different Windows Firewall rules apply to network connection based on the network profile of NIC.
In Windows 10, we can check the current network profile (location) assigned to the network connection in the Settings -> Network & Internet.
In the classic Control Panel, the network type for active network connections is displayed here: Control Panel -> All Control Panel Items -> Network and Sharing Center. But, we cannot change the assigned network location from there.
For instance, in Windows Server 2012 R2/Windows 8.1, we can only change the network profile through the PowerShell, registry, or local security policy.
How to Set a Network Profile in Windows 10
We select a network profile in Windows 10 when the device connects to the new network for the first time. Generally, a prompt appears:
If we select “Yes”, the Private profile will assign to the network, and if we select “No“, the Public profile. The next time we connect to the same LAN or WiFi network, it will automatically assign the previous profile.
We can hide the “Network Location Wizard” when connecting to a new network through the registry. We just need to create an empty registry key:
Once done, all networks will be Public.
We can reset all settings and profiles for saved networks in Windows 10 from Settings -> Network & Internet -> Status -> Network. Then, reset and reboot the computer.
Now as we connect to the network, a network discovery request will appear again.
[Need assistance to Set a Network Profile in Windows? We are available 24*7]
Change a Network Location from Public to Private on Windows
We can change the network profile from the Windows 10 GUI. If we are using the new Settings panel, go to Network & Internet -> Status -> Change connection properties.
Here we can switch the network location profile from Public to Private and vice versa.
We cannot change the network profile from the classic Control Panel in Windows 10.
Also, we cannot change the network profile on the domain-joined computer. The Domain profile will always be for a domain network connection.
[Hard to change location? We’d be happy to help.]
Change Network Types Using PowerShell in Windows
On Windows 10/Windows Server 2016/2019, we can manage network connection location from the PowerShell. To do this, we run the elevated PowerShell console.
We use the
Get-NetConnectionProfile cmdlet to get a list of network adapters on the computer and their associated network profiles.
For instance, there is only one physical network adapter on a computer with a Public network location type.
Now, let us try to change the assigned network profile for the NIC. We need to get the index assigned to this network card.
For example, here the InterfaceIndex is 8.
Name : Network 2 InterfaceAlias : Ethernet0 InterfaceIndex : 8 NetworkCategory : Public IPv4Connectivity : Internet IPv6Connectivity : NoTraffic
After we get the network adapter index, we can change the network type to Private:
Set-NetConnectionProfile -InterfaceIndex 8 -NetworkCategory Private
Check that the network profile has changed:
Get-NetConnectionProfile -InterfaceIndex 19
The new firewall rules will be applied to the interface according to the assigned network profile without rebooting.
We can also change the network profile for all network adapters of the computer at once:
Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private
Setting Network Type Using Windows Registry
The network type can also be changed from the Registry Editor. To do this, we run
regedit.exe and go to the following key:
This registry key contains profiles of all network connections.
We can find the necessary network profile by its name listed in the ProfileName registry parameter.
The network type is specified in the Category parameter. The following values are available:
- 0 — Public Network
- 1 — Private Network
- 2 — Domain Network
Change the key value to the one we need and restart the computer.
[Stuck with the procedures? We are here for you]
Change Network Location Type Using Security Policy
Another way to change the network location type is to use the Local Security Policy Editor.
We run the
secpol.msc snap-in and go to the section Network List Manager Policies. On the right, find the network by its name in the Network and Sharing Center.
Then, open the network properties, and go to the Network Location tab, change the network type from Not configured to Private, and save the changes.
To prevent users from changing the network profile, select the option “User cannot change location”.
If a server or a computer is joined to the AD domain, we cannot change the network type. After the reboot, it will automatically change back to the Domain Network.
[Confused with Network Profiles? We’d be happy to assist.]
To conclude, we saw the concept, types, and the use of network profiles in Windows. We saw some effective ways our Support Engineers employ to change a Network Location from Public to Private on Windows.