I found this code on the site, but receive an error:

ERROR : Error in expression: this type of array not supported in expressions.!
Script: X:\nomail.KIX
Line : 6

Code:

BREAK ON
$ou = GetObject("LDAP://ou=Users,dc=domain.dc=local")
Dim $Filter[0]
$Filter[0] = "user"
$ou.Filter = $Filter
for each $account in $ou
$name = $account.name
? "name = $name"
$groups = $account.groups

for each $group in $groups
$groupname = $group.name
?"groupname = $groupname"
if $groupname = "Internet Mail Access"
?"Internet Mail Access is enabled"
exit 0
else
GroupAdd($account,"Internet Mail Denied", $account)
?"No Internet Mail"
endif
next
next



tjcarst