This is what I have now. I had to strip off the leading server portion and add back in for the group names in order to match the syntax of my script that I am using. The printers in AD are preceded by the server name with a dash and not an underscore and the server is in uppercase. MRH-01-q-mis not mrh-01_q-mis.
code:
;********** Beginning of group creation *********
call @ScriptDir+'\CreateAdGroup.udf'
$printers = GetObject("LDAP://OU=Printers,DC=test,DC=local")
if @error
? @serror
else
for each $printer in $printers
$printername = $printer.name
$printername = substr($printername,4)
if left($printername,7) = "MRH-01-"
$printername = lcase(substr($printername,8))
$defprintgroup="DefPrinter_mrh-01_"+$printername
$rc=CreateADGroup($defprintgroup)
$addlprintgroup="AddlPrinter_mrh-01_"+$printername
$rc=CreateADGroup($addlprintgroup)
endif
next
endif
[ 14. October 2003, 20:26: Message edited by: tjcarst ]