
Bode
Novice
Aug 8, 2002, 7:15 AM
Post #1 of 2
(3703 views)
|
|
"Win32_NetworkAdapter"
|
Can't Post
|
|
I want to get the MAC address. The problem is it returns the correct MAC address that i want i.e 00:04:76:DC:D6:EC but it also returns another (when the foreach loops again) 50:50:54:50:30:30. I only want the first one. Does anyone know what this second part is ? I tryed to get round it by putting this $varible in to an array. However when i do this it adds both strings to element[0]. Is there a way to write the code below so it is not in a loop ? Or any other way to get round this problem? Heres my code snippet. Im trying to gather system information. #Get MAC Address foreach $Object (in ($WMIServices->InstancesOf( "Win32_NetworkAdapter" ) ) ) { $MAC = ($Object->{MACAddress}); print" $MAC"; } Cheers for any hints, tips, or explanations.
|