I notice that your GetObject line has a "." in it. It should be a comma. You should do some error checking after the GetObject command to verify that you where able to properly get the object for the OU.

Code:

BREAK ON

$ou = GetObject("LDAP://ou=Users,dc=domain,dc=local")
If @ERROR @SERROR ? EndIf
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