OS X v 10.6.x - setting up multiple smb printers

home | blog | Terrible people and places | Covid-19 links | Teh Internet | guest blog |rants | placeholder | political | projects | Gwen and Liam | Citadel patched | Tools | Scouts

If you are setting up many printers many times, it would probably be good to script instead of using the gui
See the following for hints:

Of course, replace the ppd with the correct one for your printer
And just repeat for multiple printers. Suppose you could whip up a nice Python / EasyDialogs to pick the ppd's
and build the script, but that would probably be overkill - and the reason you avoided a gui in the first place :-)
/usr/sbin/lpadmin -p "Printer_Name_Locally" -v "smb://print-user:print-user-password@workgroup/servername-or-ip/Smb Printer Share Name" -P "/Library/Printers/PPDs/Contents/Resources/HP LaserJet 4050 Series.gz" -o printer-is-shared=false

/usr/sbin/lpadmin -p "Printer_Name_Locally" -v "smb://print-user:print-user-password@workgroup/servername-or-ip/Smb Printer Share Name" -P "/Library/Printers/PPDs/Contents/Resources/HP LaserJet 4050 Series.gz" -o printer-is-shared=false -E

The first instance creates it, the second one enables it
Not sure why we can't do it all in one, but the current man page says the -E is for encryption while it is obviously not!
Looks like the man pages need some love in OS X v 10.6

To get it to run from the "finder" - always hated that name. Anyway, you just chmod a+x the script and give
it the extension .command

It might be good to set the default printer as well:
(if you need to list the printers):
lpstat -p -d
(to set the default printer):
lpadmin -d printername

This will prompt for the user password, so you will need to look for it in the shell.

To set up options, query with:
lpoptions -p printername -l

Set them with:
lpadmin -p "Main_Office" -o PaperSources=PF-706

Season with additional -o's to taste...

Another way to find settings is to set them in the GUI, and then run strings on the /etc/cups/ppd/PrinterName.ppd
If you run a before and after and sdiff, you can find what you are after.