Sunday 18 March 2018

Windows 10 how to change an interface network category using Powershell

By default the windows 10 firewall uses three categories of network to determine what firewall rules to apply to a network interface, public, private and domain.

The Public category is intended for network connections to public networks and applies the most restrictive firewall ruleset.

The Private category is intended for network connections to trusted networks like a home network and the firewall ruleset is more relaxed.

Sometimes Windows incorrectly assigns a network connection to the wrong category.

Follow the following steps to determine what network category has been applied to a network connection and if necessary change it


Step 1 - Run Powershell as admin

Step 2 - Run the command 'get-netconnectionprofile' to view the network category for each network connection

Example output:
 
Name             : Unidentified network
InterfaceAlias   : vEthernet (Default Switch)
InterfaceIndex   : 9
NetworkCategory  : Public
IPv4Connectivity : NoTraffic
IPv6Connectivity : NoTraffic

Name             : Network
InterfaceAlias   : Ethernet
InterfaceIndex   : 16
NetworkCategory  : Private
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic


Step 3 - Use the 'set-netconnectionprofile' command to change the interface network category

For example:
set-netconnectionprofile -InterfaceIndex 9 -NetworkCategory Private