Configure printers by script on Mac OS X

Recently found a solution to add a printer through a shell script or simply by the Terminal if the computer has nothing other than SSH:

Command :

sudo /usr/sbin/lpadmin -p <Printer name> -L "<Location>" -E -v lpd://<address IP or DNS> -P <Path to the PPD>

Example :

sudo /usr/sbin/lpadmin -p HP-LASERJET-2200 -L "Steve's office" -E -v lpd:// -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 2200.gz

The command is the same for IPP printers, you can replace the suffix lpd:// by ipp://.

One Reply to “Configure printers by script on Mac OS X”

  1. Thanks for the script, it works. But i have noticed that i can’t install more than 3 printers with the script it tends to uninstall the previously installed printers.

Leave a Reply

Your email address will not be published. Required fields are marked *