One of the troubles a new network connection sometimes faces in Windows 8 / 2012 is that the network is wrongly detected as Public Network when it has to be detected as Private and vice versa. You cannot change the network type from the graphical interface of Network and Sharing Center.
So, let’s use the improved Windows PowerShell in Windows 8.1 and do it quickly and easily. First of all, open PowerShell window elevated (as administrator):
You can do it in any convenient way, for example, like this:
Start-Process PowerShell.exe -verb RunAs
Now let’s see how the current network is detected in a new window that appears:
Name : Network 4
InterfaceAlias : Ethernet0
InterfaceIndex : 3
NetworkCategory : Public
IPv4Connectivity : Internet
IPv6Connectivity : LocalNetwork
Of course, you’ll get your own results. Here is a live snapshot from virtual Windows 8.1.
As you can see, the problem interface has index 3 and the network category is Public.
The same can be seen in Windows Explorer, and GUI doesn’t allow to change the connection type:
To change the situation (in my case the index equals to 3, as you remember), run the following command:
Set-NetConnectionProfile -InterfaceIndex 3 -NetworkCategory Private
And… Bingo! The connection type has been changed to Private.
The network category can also be changed from the Registry Editor. To do it, run regedit.exe and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles, containing profiles of all network connections.
You can find the necessary network profile in the Network and Sharing Center by its name listed in the ProfileName registry key. The type of network is specified in the Category value. The following values of this key are available:
- 0 — Public Network
- 1 — Private Network
- 2 — Domain Network
Change the key value to the one you need and restart your computer.
Another way to change the network category is using the Local Security Policy Editor. Run secpol.msc snap-in and go to Network List Manager Policies. On the right, find your network by its name as it is displayed in the Network and Sharing Center. Open the network properties and go to the Network Location tab, then change the network type to Private and save the changes.