I'm using WMI (Win32_NetworkAdapter) and trying to get the details of attached physical network adapters either wired or wireless and avoid virtual adapters, etc.
WMI Query list for Dell Enterprise models. For instance, since the Dell Precision models have changed the naming scheme from say Precision T3500 to Precision Tower 3610 or Precision 3620. If there is a better way to get the driver packages targeted to the systems that would be great to know as well. Any advice to clean up the queries would be appreciated. Feb 9, 2018 - To use it, save it is a PS1 file, e.g. Here's a partial solution: wmic path Win32PNPEntity where 'caption like. This should be a registry key value change, hence run CMD as Admin, and query for the key, then use REG. Connecting bluetooth headset kills wifi internet on laptop PC.
Reading this article it explains that you have to do some clever querying on WMI to eliminate virtual adapters and attempt to only return real physical adapters.
Reading this post it explains that you can compare the text in the 'Description' of the network adapter to see if it includes 'Wireless', '802.11', or 'WLAN', if it does, then most likely the adapter is a wireless adapter.
With today's .Net versions and other advancements, are these really the only two ways of determining on Windows XP+ if a network adapter is wired or wireless and is not a virtual adapter from VM software or the like? If not, please explain.
ScottNScottN1,05922 gold badges1818 silver badges3131 bronze badges
4 Answers
I see this is an old question, but I have found an answer elsewhere on the internet which gives a description of how this can be done (scroll all the way down to the comments).
The comment-er's technique allows the identification of WiFi and Bluetooth interfaces, where all other types may be grouped together. If the goal is only to separate the WiFi from the Ethernet adapters, it should be sufficient.
The queries are (Powershell sample):
The first query is the common approach which will provide the list of adapters. As previously noted, it can be filtered to only include valid, physical devices by a number of other selection criteria.
The second query returns a WMI object with a
NdisPhysicalMediumType
property, which according to the linked site, has the value 9 for WiFi, 10 for Bluetooth, and 0 for Ethernet and most other adapter types.It looks like joining these two queries has to be done manually in script using the
Name
or Description
property of the first query and the InstanceName
property of the second.nicholasnicholas
You can use new WMI class MSFT_NetAdapter in 'rootStandardCimv2' namespace. This class was introduced in Windows 8.
We can use property ConnectorPresent to filter only to physical adapters.Next we must eliminate Wi-Fi adapters (which is present among physical adapters), we can use InterfaceType and/or NdisPhysicalMedium properties.
InterfaceType is defined by the Internet Assigned Names Authority (IANA) and for all ethernet-like interfaces is value ethernetCsmacd (6) (see https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib).
In NdisPhysicalMedium is for ethernet adapters values 0 or 802.3 (14).
So my solution for this in C# is:
HolaJanHolaJan
maybe this will help you
http://weblogs.sqlteam.com/mladenp/archive/2010/11/04/find-only-physical-network-adapters-with-wmi-win32_networkadapter-class.aspx to determine the Network Adapter Type via WMI ,using the ManagementObjectSearcher class
Adrian10 BENAdrian10 BENhttp://weblogs.sqlteam.com/mladenp/archive/2010/11/04/find-only-physical-network-adapters-with-wmi-win32_networkadapter-class.aspx to determine the Network Adapter Type via WMI ,using the ManagementObjectSearcher class
66122 gold badges88 silver badges1515 bronze badges
Zoe15.9k99 gold badges6262 silver badges9494 bronze badges
JenniTalliaJenniTallia