How do I get MAC Address for all NIC in a PC using VB...???
I have 2 NIC and I want to get MAC address for both of them...
Cheers...
Printable View
How do I get MAC Address for all NIC in a PC using VB...???
I have 2 NIC and I want to get MAC address for both of them...
Cheers...
* bump *
* ouch! *
Good luck
Dim szUUID
Dim szMac
Set NetworkAdapterSet = GetObject("winmgmts:").InstancesOf ("Win32_NetworkAdapter")
iMACCount = 0
For Each NetworkAdapter In NetworkAdapterSet
If NetworkAdapter.AdapterType = "Ethernet 802.3" Then
szAdapterDescription = NetworkAdapter.Description
if NetworkAdapter.Description <> "Packet Scheduler Miniport" Then
szMAC = NetworkAdapter.MACAddress
szUUID = "00000000-0000-0000-0000-"&Replace(szMAC, ":", "")
InputBox "Based on the network adapter with the description """ & _
szAdapterDescription & """, your system's UUID would " & _
"be " & szUUID & ". This UUID has been placed in the " & _
"text area below for your convenience." , _<BR/>
"Not WFM Capable", szUUID
End If
End If
iMACCount = iMACCount + 1
Next
sorry but this seems to be incorrect bcos it gives wrong MAC Address...Quote:
Originally posted by Edilson
Good luck
Dim szUUID
Dim szMac
Set NetworkAdapterSet = GetObject("winmgmts:").InstancesOf ("Win32_NetworkAdapter")
iMACCount = 0
For Each NetworkAdapter In NetworkAdapterSet
If NetworkAdapter.AdapterType = "Ethernet 802.3" Then
szAdapterDescription = NetworkAdapter.Description
if NetworkAdapter.Description <> "Packet Scheduler Miniport" Then
szMAC = NetworkAdapter.MACAddress
szUUID = "00000000-0000-0000-0000-"&Replace(szMAC, ":", "")
InputBox "Based on the network adapter with the description """ & _
szAdapterDescription & """, your system's UUID would " & _
"be " & szUUID & ". This UUID has been placed in the " & _
"text area below for your convenience." , _<BR/>
"Not WFM Capable", szUUID
End If
End If
iMACCount = iMACCount + 1
Next
Plus I need both 2 MAC address for both NICs...
Cheers...
I belive u can find some more help here
http://support.microsoft.com/default...;en-us;Q302467
hi -
If U are still having problems - could the following be adapted? (they only get return 1 mac address but maybe could be changed in some way - dunno...)
http://www.mvps.org/vbnet/index.html...macaddress.htm
(or even
http://www.mvps.org/vbnet/index.html...ressremote.htm )
(there is some very good example code on that site)
cheers, A.J.P