OK, I just realized this is going to be a bit more complicated. Here's what I need to do:

1. (FIRST for-loop): Query ALL of the GLOBAL groups that start with glbl_grp_* (Please note * is a wildcard) from @USERID when they login and dump the results into an array called $USR_GLOBAL_GRPS[$i].

2. (INSIDE FIRST for-loop (SECOND for-loop)): Query all of the corresponding DOMAIN LOCAL groups that contain dmlcl_grp_*_printers from $USR_GLOBAL_GRPS[$i] (Please note * is a wildcard) and dump the results into an array called $USR_PRINTER_PERMS[$j].

3. (INSIDE FIRST for-loop (THIRD for-loop)): Query ALL of the installed printers on the print server and determine what their NAMES are and what DOMAIN LOCAL groups contain dmlcl_grp_*_printers. Dump those results into two arrays; an array called $CURRENT_PRINTER[$k] and an array called $PRINTER_PERMS[$l].

3. (inside FIRST for-loop (FOURTH for-loop)) Once our two arrays ($USR_PRINTER_PERMS[$j] and $PRINTER_PERMS[$l]) have been populated, start traversing and comparing both arrays

4. (INSIDE FOURTH for-loop (If-statement)): If any one of the printer's DOMAIN LOCAL groups inside the $USR_PRINTER_PERMS[$j] array match any one of the DOMAIN LOCAL groups inside the $PRINTER_PERMS[$l] array, use the addprinterconnection($CURRENT_PRINTER[$k]) function to add the printer to the @USERID logging in.

Please note that I am attempting to eliminate hard-coding username's groups and printers (With the exception of the naming convention dmlcl_grp_*_printers and glbl_grp_* used to populate the arrays).

Also could someone please shoot me some sort of code to start with, because I'm having a hell of a time with this . Thanks in advance!

Hoopes