It’s sometimes necessary to manually change the network location configuration of a Windows 2012 R2 Servers network connection. There are two common approaches to this, either by Local Group Policy or PowerShell. In this post I will be stepping through how to implement either method.
Windows classifies networks connections into one of three profiles, each profile configures the server with different firewall settings.
- Private: Used for computers on a private or home network. This allows you to see computers and devices, while making your computer discoverable.
- Public: Used for computers on a pubic network such as a coffee shop or internet café. Designed to keep your computer from being visible to other computers around you and to help protect your computer from any malicious software from the Internet.
- Domain: Used for computers that belong to enterprise network.
By default new network connections are configured with the public profile, however, if ADDS (Active Directory Domain Services) are found on the network, the profile automatically changes to domain.
Changing the Network Location by Local Group Policy
1. Run gpedit.msc to open the Local Group Policy Editor
2. Navigate to Computer Configuration / Windows Settings / Security Settings / Network List Manager Policies and double click the appropriate Network Name
3. From the popup window select the Network Location tab, then select the correct location type
4. Click OK and close the Local Group Policy Editor
5. Finally checking back in the Network and Sharing Center, the network profile should now display the options chosen in the previous steps.
Changing the Network Location by PowerShell
As with most things on Server 2012 it is possible to use PowerShell to change the network category. We first need to list the network connections and make note of the InterfaceIndex associated with the network connection we are looking to reconfigure.
1. Open an elevated PowerShell prompt and run the following CmdLet
Get-NetConnectionProfile
2. Make note of the InterfaceIndex for the network connection that requires its location changing. We can then use the following command to change the connections network location type
Set-NetConnectionProfile -InterfaceIndex <ID> -NetworkCategory <Category>
For Example:
Set-NetConnectionProfile -InterfaceIndex 12 -NetworkCategory Private
3. To confirm changes have been made, rerun the Get-NetConnectionProfile CmdLet and review the NetworkCategory reflects the change.
Thank you, it worked pretty well.
Thanks for the article which worked for me, but I noticed a typing error under the PowerShell part:
Set-NetConnectionProfule -InterfaceIndex 12 -NetworkCategory Private
You’ve spelt the above with “Profule” not “Profile”.
Updated. Thanks for pointing it out.