cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do you get a list of only physical adapters?

How do you get a list of only physical adapters?

Summary

How do you obtain a list of only the physical adapters on Windows?

Question

I am trying to obtain a list of only the physical adapters and also a separate list of the virtual adapters on Windows. I am first setting LM_A_PHYSICAL_ETHERNETID to (LM_A_VAL_TYPE)0 to obtain the list of physical and virtual adapters and then setting it to (LM_A_VAL_TYPE)1 to obtain only the physical adapters. I am then comparing the two lists and extracting the virtual adapters.

After setting LM_A_PHYSICAL_ETHERNETID to (LM_A_VAL_TYPE)0 calling lc_hostid() returns all adapters as expected. However, if you then set it to LM_A_VAL_TYPE)1, calling lc_hostid() still returns all adapters.

So how exactly can you obtain a list of only physical adapters?

Answer

Here's an example of using a WMI utility to determine which adapters are physical. That can also be done as scripted calls from something like Powershell.

Run the wmic application
c:> wmic
wmic:root\cli>

at the wmic prompt type "NIC" to display all details on all NICs on the system.

To get a subset of NIC details, and to determine what is reported as physical, enabled, and what their driver name is, type the following at the wmic prompt:

wmic:root\cli>path win32_networkadapter get description, physicaladapter, pnpdeviceid, macaddress, netenabled
Description MACAddress NetEnabled PhysicalAdapter PNPDeviceID
WAN Miniport (SSTP) FALSE ROOT\MS_SSTPMINIPORT\0000
WAN Miniport (IKEv2) FALSE ROOT\MS_AGILEVPNMINIPORT\0000
WAN Miniport (L2TP) FALSE ROOT\MS_L2TPMINIPORT\0000
WAN Miniport (PPTP) FALSE ROOT\MS_PPTPMINIPORT\0000
WAN Miniport (PPPOE) FALSE ROOT\MS_PPPOEMINIPORT\0000
WAN Miniport (IPv6) FALSE ROOT\MS_NDISWANIPV6\0000
WAN Miniport (Network Monitor) FALSE ROOT\MS_NDISWANBH\0000
Intel(R) 82579LM Gigabit Network Connection 90:B1:1C:A4:DE:42 TRUE TRUE PCI\VEN_8086&DEV_1502&SUBSYS_052C1028&REV_04\3&11583659&0&C8
WAN Miniport (IP) FALSE ROOT\MS_NDISWANIP\0000
Microsoft ISATAP Adapter FALSE ROOT\*ISATAP\0000
RAS Async Adapter 20:41:53:59:4E:FF FALSE SW\{EEAB7790-C514-11D1-B42B-00805FC1270E}\ASYNCMAC
VirtualBox Host-Only Ethernet Adapter 08:00:27:00:04:CC TRUE TRUE ROOT\NET\0000
VirtualBox Bridged Networking Driver Miniport 90:B1:1C:A4:DE:42 FALSE ROOT\SUN_VBOXNETFLTMP\0000
Microsoft ISATAP Adapter FALSE ROOT\*ISATAP\0001
Bluetooth Device (Personal Area Network) FALSE
Microsoft ISATAP Adapter FALSE ROOT\*ISATAP\0002
VMware Virtual Ethernet Adapter for VMnet1 00:50:56:C0:00:01 TRUE TRUE ROOT\VMWARE\0000
VMware Virtual Ethernet Adapter for VMnet8 00:50:56:C0:00:08 TRUE TRUE ROOT\VMWARE\0001
Microsoft ISATAP Adapter FALSE ROOT\*ISATAP\0003
Juniper Network Connect Virtual Adapter 00:FF:B0:E1:21:0D FALSE ROOT\DSNCADPT\0000
Microsoft ISATAP Adapter FALSE ROOT\*ISATAP\0004
Microsoft 6to4 Adapter FALSE ROOT\*6TO4MP\0000
Labels (1)
No ratings
Version history
Last update:
‎Dec 20, 2018 10:13 PM
Updated by: