Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you determine if an interface is a physical LAN port on a Windows PC?
    primarykey
    data
    text
    <p>I'm looking for a method to acurately determine if an interface is the physical 802.3 ethernet port on a pc in windows.</p> <p>Using ipconfig /all I can list all the interfaces, and when I do this on my pc several entries can be listed here including VPN, Bluetooth, Wifi and the physical ethernet interface.</p> <p>I'm looking for something like, "isPhysical(interface)". (It's ok to have multiple physical lan ports, I just want to know if it is a physical port or not).</p> <p><strong>UPDATE:</strong> </p> <p>Jay and Chris thanks!</p> <p>(Not enough space in the comments so I'll post here)</p> <p>I'm currently looking at using WMI Win32_NetworkAdapter. However, it shows 4 interfaces with AdapterType="Ethernet 802.3".</p> <p>I only have 1 phyical port on my pc the others have the Name, "Virtual Machine Network Services Driver". (I assume these are installed by my company for some nefarious reason)</p> <p>I found the attribute I need in the interface, but it's not available in winXP!!!</p> <blockquote> <p>PhysicalAdapter Data type: boolean Access type: Read-only</p> <p>Indicates whether the adapter is a physical or a logical adapter. If True, the adapter is physical. <strong>Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0: This property is not available.</strong></p> </blockquote> <p>Is there any way to determine if it's a physical port, other than doing a text filter for the word "Virtual" in the name?</p> <p><strong>UPDATE 12/08</strong></p> <p>Looks like the virtual interfaces are added when you have a VM installed.</p> <p>Here's some details about the virtual adapter: <a href="http://blogs.msdn.com/virtual_pc_guy/archive/2005/04/01/404816.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/virtual_pc_guy/archive/2005/04/01/404816.aspx</a></p> <p>Found an issue where if the user doesn't have admin rights the WMI interface doesn't return the data needed. So, now looking at the GetAdapterInfo method. However, it seems to add 'virtual machine services driver" to the actual adapter's description, making the 'virtual' text check invalid.</p> <p>And the structure returned by GetAdapterInfo:</p> <p><a href="http://msdn.microsoft.com/en-us/library/aa366062(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa366062(VS.85).aspx</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload