Check Active Internet Connection

by Jan 20, 2012

If your machine is connected to the Internet more than once, let's say cabled and wireless at the same time, which connection is used? Here's a function that tells you (thanks for inspiration to fellow MVP Richard Siddaway):

function test-ipmetric {
    Get-WmiObject Win32_NetworkAdapter -Filter "AdapterType='Ethernet 802.3'" |
    ForEach-Object { $_.GetRelated('Win32_NetworkAdapterConfiguration') } |
    Select-Object Description, Index, IPEnabled, IPConnectionMetric
}

Twitter This Tip!
ReTweet this Tip!