Hello

Short script to map printers based on groups, but it seems that the first group maps all printers, i thought the ENDIF parameter should stop the script in my kix, or am i wrong? Group Print_Lager should in my mind only get the Xerox WorkCentre 7855 PS printer ?
And the other groups, should get the corresponding printers under the ifingroup syntax? Server2012

 Code:
If InGroup("Print_Lager")
DELPRINTERCONNECTION("\\SERVER\HP LaserJet 600 (RESEPSJON)")
DELPRINTERCONNECTION("\\SERVER\HP LaserJet 600 M601 (NPID8D2BE) Ny")
DELPRINTERCONNECTION("\\SERVER\RICOH MP C4503 (NY)")
DELPRINTERCONNECTION("\\SERVER\Xerox WorkCentre 7855 PS")
AddPrinterConnection("\\SERVER\Xerox WorkCentre 7855 PS")
SetDefaultPrinter("\\SERVER\Xerox WorkCentre 7855 PS")
ENDIF
If InGroup("Print_Admin")
DELPRINTERCONNECTION("\\SERVER\RICOH MP C4503 (NY)")
DELPRINTERCONNECTION("\\SERVER\RICOH VISMA")
DELPRINTERCONNECTION("\\SERVER\HP LaserJet 600 M601 (NPID8D2BE) Ny")
AddPrinterConnection("\\SERVER\RICOH MP C4503 (NY)")
AddPrinterConnection("\\SERVER\RICOH VISMA")
AddPrinterConnection("\\SERVER\HP LaserJet 600 M601 (NPID8D2BE) Ny")
SetDefaultPrinter("\\SERVER\RICOH MP C4503 (NY)")
ENDIF
If InGroup("Print_Resepsjon")
DELPRINTERCONNECTION("\\SERVER\RICOH MP C4503 (NY)")
DELPRINTERCONNECTION("\\SERVER\RICOH VISMA")
DELPRINTERCONNECTION("\\SERVER\HP LaserJet 600 M601 (NPID8D2BE) Ny")
AddPrinterConnection("\\SERVER\RICOH VISMA")
AddPrinterConnection("\\SERVER\RICOH MP C4503 (NY)")
SetDefaultPrinter("\\SORLIEDC\HP LaserJet 600 (RESEPSJON)")

Tnx for any help -
Best regards!


Edited by Mart (2016-10-19 02:45 PM)
Edit Reason: Added code tags.