Quote:

I have just tested the script and you are right, it fails automatically to the other printer, wich is fine, and it sets the default printer. But as you can see there are more then one printer per zone,and I would like to mapp all the printers that the user has access too !? I also get this error..
Mapping primary printer path \\SRIM6122\PRIM1551 *FAILED*
Mapping alternative printer path \\SRIM6109\PRIM1551 OK
Setting printer as default
ERROR : invalid method/function call: missing ')'!
Script: \\srim4790\scripts$\netprint.kix
Line : 31




It should map all printers, but there is a typo in the code.

Try this:
Code:
CLS 

Select
Case Not InGroup("PF4Z3")
$asPrinterList= "\\SRIM6122\PRIM1551|\\SRIM6109\PRIM1551",
"\\SRIM6109\PRIM1550|\\SRIM6122\PRIM1550",
"\\SRIM6122\PRIM1782|\\SRIM6109\PRIM1782",
"\\SRIM6109\PRIM1347|\\SRIM6122\PRIM1347"
Case InGroup("PF4Z4")
$asPrinterList= "\\SRIM6122\PRIM1551|\\SRIM6109\PRIM1551",
"\\SRIM6109\PRIM1550|\\SRIM6122\PRIM1550",
"\\SRIM6122\PRIM1782|\\SRIM6109\PRIM1782",
"\\SRIM6109\PRIM1347|\\SRIM6122\PRIM1347"
EndSelect

$iDefaultDone=0
For Each $asPrinterPair In $asPrinterList
$asPrinterPair=Split($asPrinterPair,"|")
"Mapping primary printer path "+$asPrinterPair[0]
If AddPrinterConnection($asPrinterPair[0])
" " Color r+/n "*FAILED*" Color w/n @CRLF
"Mapping alternative printer path "+$asPrinterPair[1]
If AddPrinterConnection($asPrinterPair[1])
" " Color r+/n "*ALSO FAILED*" Color w/n @CRLF
"Reason: ["+@ERROR+"] "+@SERROR+@CRLF
Else
" " Color g+/n "OK" Color w/n @CRLF
If Not $iDefaultDone
"Setting printer as default"
If SetDefaultPrinter($asPrinterPair[1])
" " Color r+/n "*FAILED*" Color w/n @CRLF
"ERROR: Could not set printer as default."+@CRLF
"Reason: ["+@ERROR+"] "+@SERROR+@CRLF
Else
" " Color g+/n "OK" Color w/n @CRLF
$iDefaultDone=1
EndIf
EndIf
EndIf
Else
" " Color g+/n "OK" Color w/n @CRLF
"Setting printer as default"
If Not $iDefaultDone
If SetDefaultPrinter($asPrinterPair[0])
" " Color r+/n "*FAILED*" Color w/n @CRLF
"ERROR: Could not set printer as default."+@CRLF
"Reason: ["+@ERROR+"] "+@SERROR+@CRLF
Else
" " Color g+/n "OK" Color w/n @CRLF
$iDefaultDone=1
EndIf
EndIf
EndIf
Next