I go a parallel ping but I limit it to about 30 machines at a time and I send 2 pings...
Requires WSHPipe(), pping.exe, PortQry.exe (if port scanning is wanted)
Code:
$arrIPs = pping($arrIPs,30)
for each $ip in $arrIPs
Shell 'PortQry.exe -n '+$IP+' -e 135 -nr -q'
if not @error
$nbt= wshpipe('%comspec% /c nbtstat -A '+$ip+' |find "<20>"',1)
$name = trim(substr($nbt[0],5,15))
if $name > ' '
? $name
else
? "unable to resolve "+$ip
endif
else
? $ip+" is not running Windows or has firewall"
endif
next
Function PPing($Array,optional $Number)
Dim $pos, $t, $name, $return, $iter, $run, $ubound
$ubound=ubound($Array)
if not $number $number=$ubound endif
$t=''
While not $pos > $ubound
$run = ''
$iter = 0
Do
$run = $run +' '+ $Array[$pos]
$iter = $iter + 1
$pos = $pos + 1
until $iter > $Number or $pos > $ubound
$return = WshPipe('%comspec% /c pping /report:ok /times:2'+$run+ ' |find " is ok"',1)
if VarType($return) & 8192
for each $Line in $return
$name = trim(split($line)[0])
if $name > ' '
$t=$t+@crlf+$name
endif
next
endif
loop
$PPing=split(substr($t,3),@crlf)
EndFunction
I usually use MOAN() to populate the input array