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://.

2 Replies 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.

  2. hello, thank you for sharing. it seems to be operational.
    How can we add the options? (optional tray, duplex unit)
    Thank you

Leave a Reply

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