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://192.168.1.10 -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://.
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.
hello, thank you for sharing. it seems to be operational.
How can we add the options? (optional tray, duplex unit)
Thank you