Skip to main content
Question

Add Printer via command line MacOs


Forum|alt.badge.img+4

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

DBrowning
Forum|alt.badge.img+24
  • Esteemed Contributor
  • 668 replies
  • February 3, 2020

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

Forum|alt.badge.img+4
  • Author
  • Contributor
  • 24 replies
  • February 3, 2020

Thank you for ur response but what about this line?

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

Is this what he creates?


DBrowning
Forum|alt.badge.img+24
  • Esteemed Contributor
  • 668 replies
  • February 3, 2020

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.


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 24 replies
  • February 3, 2020

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
Forum|alt.badge.img+24
  • Esteemed Contributor
  • 668 replies
  • February 3, 2020

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


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 24 replies
  • February 3, 2020

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
Forum|alt.badge.img+24
  • Esteemed Contributor
  • 668 replies
  • February 3, 2020

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


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 24 replies
  • February 3, 2020

It's an stand alone printer.


Forum|alt.badge.img+2
  • New Contributor
  • 1 reply
  • February 3, 2020

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


DBrowning
Forum|alt.badge.img+24
  • Esteemed Contributor
  • 668 replies
  • February 3, 2020

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

Forum|alt.badge.img+4
  • Author
  • Contributor
  • 24 replies
  • February 3, 2020

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


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 24 replies
  • February 12, 2020

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?


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 24 replies
  • February 12, 2020

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?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings