Help with adding shared printers via terminal
Hello, I'm very familiar with adding printers via the command line:
lpadmin -p queue name -v ipp://172.xx.xx.xx -E -D "description" -L "location" -m everywhere (or ppd file)
However, I have a lab of iMacs at my school which have traditionally connected to a dedicated "printer server" iMac, which has 4 high quality Epson Ink Jets connected via USB and shared through Printer Sharing preferences. Well, something changed recently on the network and it's broken all installs of the printers and now we have to manually re-install these individually. I'd like to be able to simply use the lpadmin command that I already know to be able to re-install these printers, but they don't individually have IP addresses, so I'm stuck trying to get them to install via the printer server iMac.
How do I address the printers for use with the lpadmin command? I've discovered that running
lpinfo -v
shows me a very comprehensive list of all the printers being broadcast on my subnet, and I can find the printers listed here as with a very long dnssd address:
dnssd://NAME%20OF%20PRINTER._ipp._tcp.local./?uuid=A1ABC5D6-9870-4EC8-80BE-A8A0F 68A662B
I was hoping that I could simply copy this address and use it for my device_uri, but it doesn't work. If I use the "everywhere" model, then it fails saying it can't find the file and if I point it directly at the PPD, it installs, but there's no communication to the printer from the new print queue.
Can anyone please point me on the right path to being able to programmatically add printers to Macs that are being shared via bonjour?
Thanks!
MacBook, macOS High Sierra (10.13.4)