I just tested this code on a linux thin client:

 Code:
;--------Start IF_ELSE.kix--------
If Left(@WKSTA, 1) = "e"
;Delete the printer.
$rc = DelPrinterConnection("PR2-A-E9-17")
;Connect the printer.
$rc = AddPrinterConnection("\\cur-prs\PR2-A-E9-17")
;Set the printer as default.
$rc = SetDefaultPrinter("\\cur-prs\PR2-A-E9-17")
Else
;Do nothing.
EndIf
;-------- end IF_ELSE.kix--------


It works. The printer is only mapped if the user logs on from a computer where the hostname begins with an "e".


Edited by Mart (2017-04-03 08:40 AM)
Edit Reason: Please use code tags when posting code.