Set Network Location to Private in Windows 8.1 or Server 2012 R2

Sometimes a new Network Location gets mis-identified as Public when it should be Private, or the other way around. Changing this in the GUI is certainly possible, but the PowerShell method is faster. So let’s take advantage of the improved Windows PowerShell support in Windows 8.1 and do it quickly and easily.

2014-10-21 21_14_00-2012R2-DC02 on I5-PC - Virtual Machine Connection

First, let’s open up an elevated PowerShell window from our user session and find out what our current network location is set to:

  • Get-NetConnectionProfile

2014-10-21 21_12_20-2012R2-DC02 on I5-PC - Virtual Machine Connection

From this, we see that the problem interface has an Interface Index of 12. To change the network type execute the following command:

  • Set-NetConnectionProfile -InterfaceIndex 12 -NetworkCategory Private

2014-10-21 21_13_11-2012R2-DC02 on I5-PC - Virtual Machine Connection

The network has been changed to a Private Network.

2014-10-21 21_13_40-2012R2-DC02 on I5-PC - Virtual Machine Connection