List of 'physical' NICs

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of ertuu85 ertuu85 11 months, 2 weeks ago.

  • Author
  • #31869
    Profile photo of ertuu85

    Is there a way to grab a list of the 'physical' NICs on a Virtual or physical machine that will report accurately with teamed NICs or ignore things like VPN created NICs?

  • #31872
    Profile photo of Flynn Bundy
    Flynn Bundy

    It will just be working out a property that can define what exactly you're after. For example in PowerShell 4.0 (8.1/WinServer 2012R2) or later you can use:

    Get-NetAdapter -Physical

    going back to older style (2.0/3.0) you can always use:

    Get-WmiObject -class Win32_Networkadapter | Where {($_.PhysicalAdapter -eq $true)}

    On my machine this still returns my VPN connection so I would need to create the criteria to filter this out. IE:

    Get-WmiObject -class Win32_Networkadapter | Where {($_.PhysicalAdapter -eq $true) -and ($_.Manufacturer -eq 'Intel') }

    Someone might know of some other property determine true physical adapters. Hoep this helps.

  • #31874
    Profile photo of Curtis Smith
    Curtis Smith

    You could use the PNPDeviceID. If it starts with PCI, It's plug n play is via the PCI bus and by association, hardware.

    Get-WmiObject -class Win32_Networkadapter | Where {($_.PNPDeviceID -like 'PCI*')}
  • #31884
    Profile photo of ertuu85

    Ah thank both of you guys so much!

You must be logged in to reply to this topic.