ok... here is a modified version that only requires the server IP as a parameter... as it will automatically enums alls the scopes/superscopes present on the server

The optional IP parameter will isolate the return to the Info for just that IP's info

code:
 
break on

$return = EnumMAC('164.51.39.140','164.51.163.134')
for $x=0 to ubound($return,2)
? $return[0,$x] + ' ' + $return[1,$x] + ' ' + $return[2,$x]
next

Function EnumMAC($server, Optional $ip)
DIM $DHCPCMD, $command, $line, $x, $addr, $host, $mac, $scope, $superscope
DIM $arrTemp[2,0]

$x = 0
$command = 'cmd /c '+@scriptdir+'\dhcpcmd.exe '+ $server +' getsuperscopetable | find "Subnet address"'
$superscope = WSHPipe($command,1)

for each $scope in $superscope
$subnet = trim(split($scope,'=')[1])
$command = 'cmd /c '+@scriptdir+'\dhcpcmd.exe '+ $server +' enumclients ' + $subnet+' -h'
if $ip
$command = $command + ' | find "' + $ip + '"'
endif
$output = WSHPipe($command,1)
For each $line in $output
if val(left($line,1))
$arrTemp[0,$x] = trim(substr($line,4,15))
$arrTemp[1,$x] = split(trim(substr($line,21,16)),'.')[0]
$arrTemp[2,$x] = trim(substr($line,38,17))
$x = $x +1
redim preserve $arrTemp[2,$x]
endif
next
next
if $x
redim preserve $arrTemp[2,$x-1]
$EnumMAC = $arrTemp
else
exit (1)
endif
EndFunction
;********************************************************************************************
Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $WshShell, $oExec, $AllOutput, $Exit, $WshExitCode
$WshErrorMsg=""
$WshShell=CreateObject("WScript.Shell")
$oExec=$WshShell.Exec($ShellCMD)
While $Exit<>1
Dim $Output
Select
Case Not $oExec.StdOut.AtEndOfStream $Output=$oExec.StdOut.ReadAll
Case Not $oExec.StdErr.AtEndOfStream $Output=$oExec.StdErr.ReadAll
$WshErrorMsg = $Output
Case 1 $Output=-1
EndSelect
If $Output=-1
If $oExec.Status=1 $Exit=1 Endif
Else
If $NoEcho<>1 ? $Output Endif
$AllOutput = $AllOutput + $Output
Endif
Loop
$WshExitCode=$oExec.ExitCode
$WshPipe=split($AllOutput,chr(10))
Exit($WshExitCode)
EndFunction

_________________________
How to ask questions the smart way <-----------> Before you ask