Add Printer via command line MacOs

svallas
New Contributor III

Hey,

I would like to add a printer via command line. Now I find several lpadmin scripts on the web that make this possible, but I haven't succeeded yet.

So I hope I can get some help here.

If I now want to add a printer via the GUI, I can do this with the following information:

Adres: 192.100.200.300
Name: Printer123
Location: http://192.100.200.300:53000

the above information is the only thing I enter and would like to see this processed in a script, so that I can kick it off remotely.

13 REPLIES 13

DBrowning
Valued Contributor

here is an edited line that we use to install.

lpadmin -p *printqueue* -D "*Printer Display Name*" -E -v http://*printServer*/printers/*PrintQueue*/.printer -m Library/Printers/PPDs/Contents/Resources/KONICAMINOLTAC658.gz -o auth-info-required=negotiate

svallas
New Contributor III

Thank you for ur response but what about this line?

-m Library/Printers/PPDs/Contents/Resources/KONICAMINOLTAC658.gz

Is this what he creates?

DBrowning
Valued Contributor

That assigns the driver to use. So if you were going to use the Post Generic PS it would be -m drv:///sample.drv/generic.ppd or -m drv:///sample.drv/generpcl.ppd for Generic PCL.

svallas
New Contributor III

Ok shall be a stupid question, but how he get the driver? I never sign a driver when I have a new macbook, he does this automaticly?

DBrowning
Valued Contributor

you can download the drivers from the manufacture's webpage and install them or use the Generic ones I updated my last post with.

svallas
New Contributor III

Ok Ill test it out.

lpadmin -p *printqueue* -D "Test123 -E -v http://192.200.300:53000 -m /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks /PrintCore.framework/Versions/A/Resources/Generic.ppd" -o auth-info-required=negotiate"

What about printqueues ?

DBrowning
Valued Contributor

Is this on a print server or just a stand alone printer?

svallas
New Contributor III

It's an stand alone printer.

socjamfad
New Contributor

We use an Enterprise Print management solution called PrinterLogic. We push a client to WIN & MAC. The icon resides in the task bar and the user can click on it to add any printer. It will open a web browser where the user has to authenticate. Once authenticated, they will see a directory of all offices and printers within that office that are available to them to install. In the admin portal, you upload drivers for MAC/WIN and based on their OS, it will install automatically.

https://www.printerlogic.com/

Attached a screenshot for example
e2edd9110b6f4e4485bd7a734b371528

DBrowning
Valued Contributor

You will probably want to use something like this then....

lpadmin -p test123 -D "Test123" -E -v http://192.200.300:53000/.printer -m drv:///sample.drv/generic.ppd

svallas
New Contributor III

Thank you very much, I let you tomorrow know if I succeed.

svallas
New Contributor III

Sorry for the late response, I was only able to test with a user yesterday, because we don't do a lot of MacOs.

We can add the Ricoh printers with a generic printer driver, but they cannot print, probably because of the driver.

So I am thinking of a way how I can add this driver through the script, because if I add the printer via the GUI, then I don't have to add a driver, he does this automatically. Is there a way how I can process this in a script so that it can grab the right driver right away?

svallas
New Contributor III

I added the printer via GUI and looked up the folder.
He creates these files "RICOH MP C3003 JPN.gz" in the following folder:

/Library/Printers/PPDs/Contents/Resources/

Are these files sufficient to add the printer?