Okay, using this code, I am able to get the printer names from the Printers OU and trim off the CN=. I just need to now create the variables for the new groups I want to create using CreateADGroup.udf
code:
;********** Beginning of group creation *********
$logfile=c:\printers.xls
$printers = GetObject("LDAP://OU=Printers,DC=madonna,DC=local")
if @error
? @serror
else
$rc=redirectoutput($logfile,1)
for each $printer in $printers
$printername = $printer.name
$printername = substr($printername,4)
if left($printername,7) = "MRH-01-"
$printgroup = substr($printername,8)
? $printgroup ; write output to file for now
endif
next
$rc=redirectoutput('')
endif
[ 14. October 2003, 19:56: Message edited by: tjcarst ]