Why not break as soon as the user is found in the list ?

I have taken the liberty to make some small changes in Bryce's script [Eek!]

This should perform even better:
code:
break on

$domain = getobject("WinNT://@ldomain")

Dim $userlist[5]
$i = 0

$domain.filter = "group",""

for each $group in $domain
if substr($group.name,1,3) = "abc"
for each $user in $group.members
if $user.class = "user"
$j = 0
$NotInList = 1
While $j <= $i And $NotInList
if $userlist[$j] = $user.name
$NotInList = 0 ; User found, stop searching
endif
Loop
if $NotInList
$userlist[$i] = $user.name
$i = $i + 1
if ubound($userlist) = $i-1
redim preserve $userlist[ubound($userlist) + 5]
endif
endif
endif
next
endif
next

redim preserve $userlist[$i-1]

for each $name in $userlist
? $name
next

-Erik