Something simple as this should work. Please keep in mind that the AddPrinterConnection function requires the share name of the printer (something like \\server\printer01) and SetDefaultPrinter requires the name of the printer (HP LaserJet Finance for example).

To avoid issues with adding printers and setting them as default I always keep the printer name and the share name exactly the same. This is not a requirement but it makes things a heck of a lot easier.

 Code:
Break on

If InGroup("AD_groupname")
	$rc = AddPrinterConnection("\\Server\PrinterShareName")
	? @ERROR
	? @SERROR
	$rc = SetDefaultPrinter("Printername")
	? @ERROR
	? @SERROR
Else
	? "User " + @USERID + " is not in the correct AD group"
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.