You can use
smbclient to print files. I'm able to print via Samba to one of my printers like so:
$ smbclient -U <user> //server/printer -c "print <filename>"
$ smbclient -U sam //bart/mfc-8480dn -c "print hello_printer.txt"
Enter sam's password:
Domain=[BUBBA] OS=[Unix] Server=[Samba 3.0.33-3.39.el5_8]
putting file hello_printer.txt as hello_printer.txt (0.2 kb/s) (average 0.2 kb/s)
I also found this example here in a thread titled: Lion Kerberos printing. There are 2 methods.
Method #1 - Printers already installed
$ sudo lpadmin -p PRINTERNAME -o auth-info-required=negotiate
Method #2 - Adding printer
$ sudo lpadmin -p PRINTERNAME -E -v smb://PRINTSERVER/PRINTQUEUE \
-m Generic.ppd -L "LOCATION" -o auth-info-required=negotiate
In either case once you've run one of the above commands you should be able to do
lpr -P PRINTERNAME after configuring the SMB printer.
NOTE1: You may be able to add usernames & domains to the
smb:// line if needed. I did not test that facility however. Also the
-U <username> switch allows for overriding your username.
NOTE2: This method will create a printer with the credentials cached, which may not be what you want, but will allow
lpr to send prints to a SMB printer, just without the credentials included.