How about something like this:
code:
; Get the global groups to which the user is a member
;
$Index = 0
$PrinterSet = 0
$NonPrinterGrps = "Domain Users,Domain Admins,Some Other Grps"
$Domain = "@Ldomain\"
DO
$Group = ENUMGROUP($Index)
if instr($Group, $Domain)
$Group = substr($Group,len($Domain)+1)
if instr($NonPrinterGrps, $Group)=0
$Printer = ReadProfileString("printer.ini", "Printers", "$Group")
if $Printer <> ""
SetDefaultPrinter ($Printer)
$PrinterSet = 1
endif
endif
endif
$Index=$Index+1
UNTIL $PrinterSet=1 or Len($Group) = 0
Then create your printer mapping file in INI file format.
code:
;Printer configuration mapping file
[Printers]
WELGN=welgn01
Lsbprt=lsb01
Whitefishbay=wbay
Newberlin=nbe01
Foxpoint=foxpoint
BARTLETT=bart
[ 29 March 2002, 22:29: Message edited by: Howard Bullock ]