It depends how many printers you have. what I am doing is create a .INI file that lists the printer and the groups that map to that printer. I then loop through the printer list and check whether that particular user is part of a group that need the printer mapped. Sounds complicated but in the end you have soemthing like 15 lines of code plus the .INI file.
Here's an example:
code:
; PRINTERS.INI
[Printer1]
Server=Server1
Groups=GroupA, GroupB

code:
$printers=readprofilestring('printers.ini','','')
for each $printer in $printers
$mapprinter=0
$groups=readprofilestring('printers.ini',$printer,'Groups')
$groups=split($groups,',')
for each $group in $groups
if ingroup($group)
$mapprinter=1
endif
next
if $mapprinter
$server=readprofilestring('printers.ini',$printer,'Server')
$rc=addprinterconnection('\\'+$server+'\'+$printer)
endif
next

_________________________
There are two types of vessels, submarines and targets.