0

I know I can use GetAdaptersAddresses to retrieve information for the network interfaces on a machine. Additionally, I would like to determine which of those interfaces refer to network cards integrated on the motherboard. The requirement is similar to that discussed here: https://stackoverflow.com/a/3530362/2833126/. The accepted answer there is to check whether the card is a PCI device. I don't think this will work because I believe integrated cards are reported as PCI devices (I can't actually test this right now as I don't have access to a Windows machine right now... at least they show up in the lspci output on Linux).

The use case for this is similar to that mentioned in the SO post linked above: to generate a unique system ID based on the MAC address. I would like to use the MAC address of an integrated card since it is attached to the motherboard and for my problem I would like the system ID to correspond to the motherboard.

Community
  • 1
  • 1
aschmied
  • 908
  • 2
  • 10
  • 26
  • 1
    I'd be surprised if there was a general and reliable method for differentiating between integrated and discrete. – NPE Aug 13 '14 at 17:53
  • Well, it doesn't necessarily need to reliable since using MAC addresses at all is error prone. Something like 90% is probably good enough. Generality is a requirement, though. This is for a non-critical feature, so I don't want to write hundreds of lines of vendor-specific special cases. – aschmied Aug 13 '14 at 18:49
  • Just make sure you handle the case where there is no on-board adapter! – Harry Johnston Aug 13 '14 at 21:20

1 Answers1

1

check Win32_OnBoardDevice class
in powershell you can do:

PS C:\temp> gwmi Win32_OnBoardDevice|?{$_.devicetype -eq 5} |select -expand description
Broadcom 5754 NetXtreme Gigabit Controller
Loïc MICHEL
  • 24,935
  • 9
  • 74
  • 103
  • This looks promising. Do you know whether any of the Win32_OnBoardDevice fields can be matched against fields in [IP_ADAPTER_ADDRESSES](http://msdn.microsoft.com/en-us/library/windows/desktop/aa366058%28v=vs.85%29.aspx)? It looks like `Name` and `AdapterName` might be the only possibility. – aschmied Aug 13 '14 at 21:56
  • hum... not easy, i thought description would have match with Win32_NetworkAdapterConfiguration but it's not the case ... – Loïc MICHEL Aug 14 '14 at 06:17