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
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
Set-NetConnectionProfile -InterfaceIndex <ID> -NetworkCategory <Category>
Set-NetConnectionProfule -InterfaceIndex 12 -NetworkCategory Private