If you have more than one network card active at the same time which one will take the priority over the others?

Sometimes may happen that you have your laptop connected to the wired network and the wireless one at the same time and the wireless NIC take the presence.

When this happens you are not enjoying the fastest possible connection to your resources.

How the priority is really assigned initially by the OS to the NICs is not really clear to me but everything is decided by the value of the parameter IPConnectionMetric .

To have a look at the current settings for this value in your system you can run this PowerShell script:

Get-WmiObject-ClassWin32_NetworkAdapter-Filter"AdapterType='Ethernet 802.3'"|

foreach {

 Get-WmiObject-ClassWin32_NetworkAdapterConfiguration-Filter"Index=$($_.DeviceId) AND IPEnabled = True"  |

 selectDescription,IPConnectionMetric,IPAddress|ft-AutoSize

}

Bigger the value of IPConnectionMetric lower is the priority for this NIC

If you want to amend the value for all the Wireless adapters and make the other (wired) adapters to have precedence over the Wireless adapter you can run the following script:

It will set the IPConnectionMetric of the wireless cards to 900. A reboot will be necessary to enforce the setting.

 

Get-WmiObject-ClassWin32_NetworkAdapter-Filter"AdapterType='Ethernet 802.3' AND NetConnectionID like '%Wireless%'"|
foreach {
        Get-WmiObject-ClassWin32_NetworkAdapterConfiguration-Filter"Index=$($_.DeviceId) AND IPEnabled = True"  |
        Invoke-WmiMethod-NameSetIPConnectionMetric-ArgumentList 900
 }