I think there is a problem with creating the groups from the script due to the way they are created using for each $printer in $printers.

I can get the script to return the correct name of the group I want to create for $defprinter, but I cannot create multiple computer groups based upon the printer names.

Using CreateADGroup.udf, I can create a script that creates one group successfully, just not the whole listing retrieved by 'for each'

Somehow I need to store the results of the printer names and then create the group names based on my variables. To a text or ini file? How do I modify the script to do this?