Viggen, use TranslateName() UDF to determine if your group exists. If it does then the UDF will return the DN of the group.

code:
call "%tmp%\libr-prd.kix"                                   

$DN = TranslateName (3, "", 3, "@LDomain\administrators", 1)
? "DN = " + $DN[0]
? "Error = " + $DN[1]
? "ErrorText = " + $DN[2]

DN = CN=Administrators,CN=Builtin,DC=EmptyRoot
Error = 0
ErrorText = The operation completed successfully.

If not, you receive:

DN =
Error = 1
ErrorText = COM exception error "Set" ((null) - (null)) [1/1]

Do you want to create the group in a particular OU? Will it always be the same? Will the OU be input somehow?

[ 18. July 2003, 16:12: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/