Even better:
Code:
If RedirectOutput("domainusers.log",1)
"Whoops! Cannot open the output log!" ?
"Error "+@ERROR+": "+@SERROR ?
EndIf

$domain = GetObject("WinNT://"+@Domain)
For Each $object in $domain
If $object.class = "user"
? $object.name
EndIf
Next



Error return values are usually (although not always) worth checking. If you don't, they'll bite you in the bum later.