March 28, 2013 Leave a comment
Yesterday I posted a blog on Setting Network Interface Priority on Windows 8 with the GUI, today I am going to show you how to do it with PowerShell.
Firstly you are going to have to run PowerShell at an elevated prompt, to do this, simply right click on the icon and click “Run as Administrator”
Type Get-NetIPInterface to get a list of all the network interfaces on your system. The 2 interfaces we are looking for are Ethernet and Wi-Fi, both on IPv4
The Interface Metric is set to auto, and have been assigned 10 for the Ethernet and 20 for the Wi-Fi
To change this type the following to set the interface metric on the Ethernet interface to 5
Set-NetIPInterface -InterfaceAlias Ethernet -AddressFamily IPv4 -InterfaceMetric 5
Now change the Wi-Fi interface to 1
Set-NetIPInterface -InterfaceAlias Wi-Fi -AddressFamily IPv4 -InterfaceMetric 1
Now if we check the Get-NetIPInterface you will see that the interface metric for the adaptors Ethernet and Wi-Fi have changed to 5 and 1 respectively
You can also specify either IP4 or IP6 by changing the AddressFamily to either IPv4 or IPv6
Remember: You must do this for all active NICs to make sure they are in the right order.