Change network type using PowerShell in Windows Server 2016

First, to identify the network type we will use the Get-NetConnectionProfile cmdlet. As you will see in the picture below, NetworkCategory shows the network type for all network adapters.

Get-NetConnectionProfile

Change network type using PowerShell in Windows Server 2016

How to change the network type using PowerShell

Using the InterfaceAlias ​​or InterfaceIndex of the previous command, you can change the network type for the adapter you want by using the Set-NetConnectionProfile cmdlet.

Set-NetConnectionProfile -InterfaceAlias ​​Ethernet -NetworkCategory Private
Set-NetConnectionProfile -InterfaceIndex 2 -NetworkCategory Private

With the NetworkCategory switch, you can choose between the three: Public, Private, and Domain.

Alternatively, to change the network type for all machine adapters, use the following command.

Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private
About Dimitris Tonias 143 Articles
My name is Dimitris Tonias, IT Pro, G(r)eek, focused on Server, Virtualization, and Cloud technologies.

Be the first to comment

Leave a Reply

Your email address will not be published.


*