Sandeep
Sandeep

Reputation: 137

NIC binding order

I wrote a command to check NIC binding order. But the problem here is, I am getting all NIC details of the machine, but the binding order listed is not correct.

Can anyone help me to correct this command, so that I can get the NIC details in binding order ?

$adapter = Invoke-Command -ComputerName $ComputerName {(Get-NetAdapter).Name }

Upvotes: 0

Views: 1899

Answers (1)

colsw
colsw

Reputation: 3336

I believe the InterfaceMetric is the 'weight' of a specific Interface in Get-NetIPInterface, hopefully that's what you're looking for.

Get-NetIPInterface | Select Interface*,AddressFamily | Sort InterfaceMetric -Descending

Narrowing it down to only 'valid' endpoints (you can exclude IPv6 from this afterwards if needed)

Get-NetAdapter | Get-NetIPInterface | Select Interface*,AddressFamily | ? {$_.InterfaceMetric} | Sort InterfaceMetric -Desc

Upvotes: 2

Related Questions