#include <Array.au3>
$array = _GetMACAddress()
_ArrayDisplay($array)
Func _GetMACAddress()
Local $wbemFlagReturnImmediately = 0x10
Local $wbemFlagForwardOnly = 0x20
Local $strComputer = "localhost"
Local $objWMIService,$colItems,$ret[2]
$objWMIService = ObjGet("winmgmts:\\" & $strComputer& "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * From Win32_NetworkAdapter ")
For $colItem In $colItems
If $colItem .NetConnectionStatus = 2 Then
$ret[0]= $colItem .MACAddress
$ret[1]=$colItem .Name
EndIf
Next
Return $ret
EndFunc
|