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 |
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 |
thanks
Thank you Dimitris!
This is exactly what I was looking for!