I’m beginning to love Mosyle, but it definitely has its quirks. There’s a bunch of people who rave about the incredible support they get- but they live in a different time zone. For us poor people in Australia, 90% of the time we ask a support question, we have to wait until the next day for an answer.

That wouldn’t be necessary if they had good documentation, but it just doesn’t exist. All of the docs on their website are just ‘marketising’ about how easy things are without enough detail to actually complete a task. Their Youtube videos are the same- all boasting about how wonderful they are without the stuff technicians need… but I digress

Printers are an ongoing bugbear, and in fact I only learned that Apple has been trying to deprecate CUPS and printer drivers for most of this decade, like, last week. So let’s dive into a few printer setups that we’ve completed recently.

Tools

The first thing you need is a Mac with the printer installed correctly and working, we’ll be extracting some info from that. Luckily Connectwise Control allows me a remote terminal session without bothering the client. The key commands you’ll need are these, all done from the Terminal-

lpadmin

lpadmin -p PrinterName creates printer with that name- no spaces, special characters
lpadmin -D “Friendly Printer Name” Capital D specifies the user friendly name and quote marks ” allows spaces etc.
-L = location, this is user facing example 
-v this is where you specify the print queue example -v “Ipp://10.10.10.10”
-P this is where the location of the driver file is, usually in /Library/Printers/PPDs/Contents/Resources/Driver.ppd.gz
-o this describes the options that you got from lpoptions -p <printername>
-d set the printer as the default
-E enables the printer

lpstat

For completeness, here’s a couple more that are helpful-
lpstat -p outputs the info about all printers on the machine
-d outputs info about the default printer
-t outputs status information about all installed printers

tl:dr

You just want the quick way, don’t you? OK, everything you need is in these commands. At least until something goes wrong…
How? Find a machine that already has the printer set up, then run
1. lpoptions -p printername to show you what options you can set on the printer
2. lpinfo -m which lists all of the 3rd party PPDs installed and shows you the path. Copy path to the PPD
3. lpadmin allows you to programatically change a printer setup- let’s put it all together below…

Alternatively you can use the very useful PrinterSetup utility provided by Mikaell Ofgren (sp?). It very neatly helps to sort out the printer prefs and setups. Also makes it MUCH easier to set special prefs like B&W only printing etc.

Mosyle Restrictions

There is a bunch of things that will cause your installs to fail, so be aware of
A. Printer drive package must not require any user input
B. Driver package must not be over 35MB for Mosyle to host it
ok that’s 2, there’s probably more…

Mosyle Required Info

What we require to be able to do these installs is
1. Printer drivers in .pkg format
2. Name for the printer (can be anything)
3. Printer ID (no spaces or special characters)
4. Location (physical location, helps to identify if you have lots of the same model)
5. Connection path (a URL for the printer, including protocol)
6. Any special options set (you get these from the lpoptions command)
7. Path to the PPD (get this from lpinfo command)

as per the pic below from Mosyle-

Brother

The first one is for a Brother MFC-L3745CDW. There are 2 driver downloads for this, one .dmg contains all of the software wrapped up in a friendly interface, the second one is called ‘Brother_PrinterDrivers_xxxx.dmg and that’s the one you want because it doesn’t include extra cruft. Download it, extract the .pkg ready to upload to Mosyle. Now let’s run those commands on a computer that already has the printer set up-

Mac_Pro:/ admin$ lpoptions copies=1 device-uri=ipp://172.20.1.201/ipp/print finishings=3 job-cancel-after=10800 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=1595138583 marker-high-levels=100,100,100,100 marker-levels=100,50,50,50 marker-low-levels=10,10,10,10 marker-types=toner,toner,toner,toner number-up=1 printer-commands=none printer-info=’Brother MFC-L3745CDW series’ printer-is-accepting-jobs=true printer-is-shared=false printer-is-temporary=false printer-location printer-make-and-model=’Brother MFC-L3745CDW series-AirPrint’ printer-mandatory-job-attributes=attributes-charset,attributes-natural-language,printer-uri printer-state=3 printer-state-change-time=1595138614 printer-state-reasons=none printer-type=69242972 printer-uri-supported=ipp://localhost/printers/Brother_MFC_L3745CDW_series

output from lpinfo -m was too long to post here because that machine has a LOT of 3rd party drivers

So here’s the info we need for the setup-
1. Brother_Printer_Drivers.pkg
2. Brother MFC
3. BrotherMFCL3745CDW
4. Adam’s Office
5. ipp://172.20.1.201/ipp/print
6. <none for this printer>
7. Library/Printers/PPDs/Contents/Resources/Brother MFC-L3745CDW series.gz

So there we go- stick all of that into Mosyle, set the options (auto installed or self service), set who gets it, and bingo! Off you go to test it… interestingly this one did not pick up the custom icon for the printer, but others using the same method did.

EFI Fiery

Oh boy… straight from a $300 printer to a $100,000 printer. As you know, Fiery make RIPs for other people’s hardware. In practise, this just makes it twice was hard to figure out who to blame when stuff goes up in flames (fiery, geddit?). In this case, the client has an E100 RIP attached to a Konica Minolta C754e printer. So we have to get the drivers from EFI.
Look, there’s all sorts of issues here, let’s just say I processed the drivers through an Autopkg recipe provided by Foigus so they would be usable. And because that means they were already in Munki, I figured maybe I should deploy them from there, with a post install script to add the actual printer.
Original discussion of purpose here-
https://foigus.wordpress.com/2017/04/07/trial-by-fiery/
And the recipes here-
https://github.com/autopkg/foigus-recipes/tree/master/EFI
But that makes things messy, I’d rather have all the printers in one place, Mosyle.

Except you can’t, because even after processing, the driver .pkg is 37mb, and Mosyle won’t let you upload anything over 35mb. In case you’re wondering where the docs for the recipe are, they’re in the Autopkg Info description. I’ll copy them here for reference, but go back to the source in case these get updated.


setup-servicemax:~ servicemax$ autopkg info GenericFieryFD50.pkg
Description: Deconstruct a Fiery driver package, remove the Fiery Driver Updater.app, and repack. The FD50 and FD51-revision Fiery drivers appear to properly handle installing when COMMAND_LINE_INSTALL is set.

                 To start, download a FD50 or FD51 driver from:
                 http://www.efi.com/support-and-downloads/download-registration/

                 Note the name of the downloaded driver dmg (e.g. "Ricoh_E41_v1_0R_FD51_v1Cert.dmg") and create an override using the dmg name:
                 autopkg make-override GenericFieryFD50.pkg -n Ricoh_E41_v1_0R_FD51_v1Cert.pkg

                 Set the Input in the override to the following suggested items:
                 - NAME of the downloadable DMG without ".dmg", and adding "_No_Update" (e.g. Ricoh_E41_v1_0R_FD51_v1Cert_No_Update)
                 - PACKAGE_ID of com.efi.DMG-Name-with-hyphens-substituted-for-underscores.pkg
                   (e.g. com.efi.Ricoh-E41-v1-0R-FD51-v1Cert.pkg)
                 - PACKAGE_VERSION of 1.$version, where $version is the digits after "FD" in the downloaded driver (e.g. 1.51)

                 Run the recipe with the "-p" option pointing to the downloaded driver dmg:
                 autopkg run Ricoh_E41_v1_0R_FD51_v1Cert.pkg -p /path/to/Ricoh_E41_v1_0R_FD51_v1Cert.dmg

                 Also note that the way that EFI's package postinstall is written causes it to behave differently when COMMAND_LINE_INSTALL is set.  When testing the output package, make sure to use "installer" rather than double-clicking the package.  From a different point of view, when the package output from this recipe installed via the GUI (i.e. Installer.app) it will NOT have the desired result of skipping the Fiery Driver Updater installation and running non-interactively.

Identifier: com.github.foigus.pkg.GenericFieryFD50
Munki import recipe: False
Has check phase: False
Builds package: True
Recipe file path: /Users/servicemax/Library/AutoPkg/RecipeRepos/com.github.autopkg.foigus-recipes/EFI/GenericFieryFD50.pkg.recipe
Parent recipe(s): /Users/servicemax/Library/AutoPkg/RecipeRepos/com.github.autopkg.foigus-recipes/EFI/GenericFieryFD50.download.recipe
Input values:
‘NAME’: ‘%NAME%’,
‘PACKAGE_ID’: ‘com.efi.replace-me-in-an-override.pkg’,
‘PACKAGE_VERSION’: ‘1.50’

In the end I’m going to install this via Munki as an optional install and set the printer queue up as a post install task for the driver. Here’s the info we needed for that one-

1. EFI_Printer_Drivers.pkg
2. Fiery_E100
3. EFI_Fiery_E100_60_55C_KM_PS_Color_Server1_2
4. XXX Office
5. lpd://192.168.0.197/Colour_Print
6. <none for this printer>
7. Library/Printers/PPDs/Contents/Resources/en.lproj/Fiery E100 60-55C-KM PS1.2eu

Scripting

Now we need to develop the post install script for adding the print queue. Here is the vanilla command-

sudo /usr/sbin/lpadmin -p <Printer name> -L "<Location>" -E -v lpd://<address IP or DNS> -P <Path to the PPD>

Now we need to add our customisations, and it becomes

/usr/bin/lpadmin -p Fiery_E100 -L "Office" -E -v lpd://192.168.0.197/Colour_Print -P /Library/Printers/PPDs/Contents/Resources/en.lproj/Fiery\ E100\ 60-55C-KM\ PS1.2eu

Getting a bit more fancy, we might add some options and convert to a bash script, and voila-

#!/bin/bash
# Printer Setup Script for Company_Name with Fiery E100
/usr/sbin/lpadmin -p Fiery_E100 -L "Company Fiery" \
-P /Library/Printers/PPDs/Contents/Resources/en.lproj/Fiery E100 60-55C-KM PS1.2eu EFI Fiery E100 60-55C-KM PS Color Server1.2eu \
-v "lpd://192.168.201.197/Colour_Print" -o printer-error-policy=abort-job \
-o printer-is-shared=false \
-o printer-commands=AutoConfigure,Clean,PrintSelfTestPage -E

Konica Minolta

This one was relatively refreshing. The driver package wasn’t too big, the prefs were easy to find and the whole process actually went ok for once. Let’s have a look at the data we extracted from a working client-

1. C650i_C360i_C4050i_C4000i_C3320i.pkg
2. Konica Minolta C250i
3. KONICAMINOLTA_bizhub_C250i_44_9C_3E
4. <location redacted>
5. lpd://192.168.0.250/ (updated, does not match pic)
6. <none for this printer>
7.Library/Printers/PPDs/Contents/Resources/KONICAMINOLTAC250i.gz

Canon

Oh boy- the Canon driver install package has 248 scripts and 11 THOUSAND installable items. Where do you even start with that?
In addition, the client who needed this one also needed a Canon app installed so they could add a Department ID and PIN number to their print jobs for accounting purposes. I ended up doing this manually because we only needed it on 3 machines, but this is most likely going to be handled by Munki in the future too because the print driver package is over 60mb.