Installing FindMe Print Queues Without Mobility Print (MacOS)
Preamble
Mobility Print as a print queue installer works fine when clients need to install printers on their own devices, such as their phone or personal laptop. However, on managed devices, this is a sub-optimal solution, as it installs all of the published queues, cluttering the user's printer selection.
What's worse is using Mobility Print will not allow for the use of advanced printer features like paper tray selection, stapling, and 2/3 hole punch since it uses a generic AirPrint driver. Oh no!
PaperCut has a universal Windows driver, but us Mac users are left high and dry seemingly without any solution!
To remedy this, we have found the best solution is to substitute a PostScript3 driver for your specific copier models. Specifically, what we have found works best is using the PostScript PPD file for the highest end copier in your fleet.
If you have multiple different brands of copiers in your fleet, you may need to create separate FindMe queues for each brand of copier, but you could experiment with each PostScript3 driver, and see if it works on other brands of copiers.
To remedy the problems with Mobility Print, you can use two different options to manage printers and/or FindMe queues from PaperCut on managed devices.
Connection Options
Option 1 - Line Printer Daemon
- Using a
lpd://socket connection with a shared queue on the print server.- This will use the computer's username for authentication, and does NOT use password authentication. Ensure that PaperCut's usernames match the usernames on the computers.
- This socket is ideal if you want users to have direct printing to “regular” printers without the PaperCut embedded software, without the need to log in.
Option 2 - Internet Printing Protocol (Secure)
- Using a
ipps://socket connection with a shared queue on the print server.- This will bring up a system dialog popup that will ask for a username and password when the user tries to print the first time. The login information will be their PaperCut user login.
- This socket type is ideal for improving printing security, since it uses PaperCut's authentication, or if the username of the computer doesn't match what is registered in PaperCut.
Installation
After selecting which option you want to use (lpd:// or ipps://), start constructing a script to deploy the printers. Refer to the information above for more information.
Prerequisites
-
From the print server, select the print queue from Windows settings, and ensure that the printer is shared. Make note of the name that the printer is shared as, as it will be needed later.
-
Make sure that any queues on the print server are using the same driver type as the Mac client devices. From testing, it seems that both need to be using the PostScript3 driver if possible. If a PostScript driver is not available for your copiers and/or printers, you may have to experiment to see what works for you.
-
If you are using PaperCut Virtual FindMe queues, you may wish to set up additional queues, like if you want a Color versus Grayscale option for users. Refer to PaperCut's documentation to configure a FindMe queue. Make sure the FindMe queue is shared from the print server, and working correctly.
https://www.papercut.com/discover/easy-printing/find-me-printing/
-
Make sure that PaperCut NG/MF is configured how you want it on the server. Settings like Print Release and FindMe queues may need to be adjusted or configured if have created new FindMe queues. If you created a grayscale queue, now would be the time to set it to convert jobs for all users to grayscale from the PaperCut interface.
-
If previously installed, make sure the PaperCut Mobility Client has been removed. This is extremely important, since it can and will cause problems. Mobility Print will try to override the printer automatically when it decides to sync to the server, which will nuke our configuration. Boom!
Step 1 - Driver Installation
- Verify the driver exists, and if not, you should either push the driver through your MDM or pull it and install through the script using curl. To check if the driver exists, find the path to the PPD file and verify its existence through the script.
# variable to hold the path to the PPD file
PPD_PATH="/path/to/PPD.ppd.gz"
# simple command to detect the PPD path
if [ ! -f "$PPD_PATH" ]; then
echo "PPD not found!"
else
echo "PPD exists!"
fi
- If the driver doesn't exist you should install the driver like so. (Or you can push the driver through your MDM instead.)
# Variables
DRIVER_URL="https://apps.mydomain.tld/CopierBrand_PS3_Driver.pkg"
TEMP_PACKAGE_NAME="CopierBrand_PS3_Driver.pkg"
# Download the driver
echo "Downloading driver..."
curl -L "$DRIVER_URL" -o "/tmp/$TEMP_PACKAGE_NAME" 2>/dev/null
# Install the driver
echo "Installing driver..."
installer -pkg "/tmp/$TEMP_PACKAGE_NAME" -target /
- Once you download and run the installer, you should verify if the PPD exists again. If the PPD still doesn't exist, terminate the script using
exit 1to signify an error.
Step 2 - Printer Installation
- Install the printer using the
lpadmincommand. You may find an example below. Note this example is not using variables, and is therefore hard-coded. You may refer to the example script to see a more advanced configuration.
lpadmin -p "User-Visible-PrinterName" -v "lpd://ip.of.print.server/ServerPrintQueue" -P "/Library/Printers/PPDs/Contents/Resources/PS3PPDfile.ppd.gz" -o printer-is-shared=false
- This command will use the
lpadmincommand to specify a printer namedUser-Visible-PrinterNamethat will connect of alpd://socket to the print server atip.of.print.serverwith the shared print queue name ofServerPrintQueue. It will then make sure the printer is set to use the PPD file found at'/Library/Printers/PPDs/Contents/Resources/PS3PPDfile.ppd.gz'. Make sure to change all of these to your desired values.User-Visible-PrinterName- The name of the printer displayed to the userlpd://- Socket to be used for connection (options arelpd://oripps://)
Step 3 - Printer Configuration
FindMe Queues:
- Once the printer has been added with the correct PPD file, you may now modify whichever settings you need to modify for the printer to match the specifications of your machines. We recommend setting the configuration based on the most feature rich copier matching the model number of the PPD file you just selected.
Individual Printers/Copiers:
- Simply select the printer options based on what suits the individual printer or copier you just added in the previous step.
Finding Available Options:
- To find the available options for your copier with the PPD file, go to a computer with the copier installed using the correct driver and PPD file, and run
lpoptions -p PrinterName -l. This should list the available options of the copier based on the selected PPD file. - The main settings you should be looking for are finishers (booklet or otherwise), stapling, and other machine-specific settings.
Setting Available Options:
- To set printer options based on what you gathered from the
lpadmincommand, refer to the following code snippet.
lpadmin -p "PrinterName" -o "Option=MySetting"
- Here,
lpadminsets the global configuration for the printer, instead of the user config, likelpoptions.
Example Script
#!/bin/bash
# --------------------- Variables --------------------- #
# List of desired printers to be added
# These names should match the names of the print queues shared on the print server
DesiredPrinters=("ORG-FollowMe-Color" "ORG-FollowMe-Grayscale")
ColorPrinters=("ORG-FollowMe-Color")
GrayscalePrinters=("ORG-FollowMe-Grayscale")
# List of printers to be removed
# This is useful if you have printers you don't want, or are trying to replace
# If you don't have any printers you want to remove, just set PrinterNames=()
PrinterNames=("Printer1" "Printer2")
# Print server connection configuration
SocketType="ipps://"
ServerIP="0.0.0.0" # can be set via local IP or local DNS name
# Driver download URL
DRIVER_URL="https://apps.yourdomain.tld/CopierBrand_PS3_Installer.pkg"
TEMP_PACKAGE_NAME="CopierBrand_PS3_Installer.pkg" # name of package in /tmp directory
# Path to the PPD file used for configuring the printers
PPD_PATH="/Library/Printers/PPDs/Contents/Resources/PS3PPDfile.ppd.gz"
# List of variables to set for the desired printers
# These values were grabbed from a Canon C7765i, modify them to your needs
# Remember you can get all of the available options for your copier using the lpoptions command
# Common Options are set for both color and grayscale
CommonOptions=("PageSize=Letter" "Collate=True" "CNDuplex=None" "CNPuncher=PUNU23" "CNFinisher=BFINX1")
ColorOptions=("CNColorMode=color" "ColorModel=RGB" "CNUseGrayScaleProfile=False")
GrayscaleOptions=("CNColorMode=mono" "ColorModel=Gray" "CNUseGrayScaleProfile=True")
# --------------------- Functions --------------------- #
configure_printers() {
# Set the printer PPD file for the desired printers
echo "Setting printer PPD file..."
for DesiredPrinter in "${DesiredPrinters[@]}"
do
lpadmin -p "$DesiredPrinter" -P "$PPD_PATH" 2>/dev/null
echo "PPD file set for $DesiredPrinter."
done
# Ensure printer sharing is disabled on the client devices
echo "Applying shared printer options..."
for CommonOption in "${CommonOptions[@]}"
do
for DesiredPrinter in "${DesiredPrinters[@]}"
do
lpadmin -p "$DesiredPrinter" -o "$CommonOption" 2>/dev/null
echo "Applied $CommonOption to $DesiredPrinter."
done
done
# Apply color printer options
echo "Applying color printer options..."
for ColorPrinter in "${ColorPrinters[@]}"
do
for ColorOption in "${ColorOptions[@]}"
do
lpadmin -p "$ColorPrinter" -o "$ColorOption" 2>/dev/null
echo "Applied $ColorOption to $ColorPrinter."
done
done
# Apply grayscale printer options
echo "Applying grayscale printer options..."
for GrayscalePrinter in "${GrayscalePrinters[@]}"
do
for GrayscaleOption in "${GrayscaleOptions[@]}"
do
lpadmin -p "$GrayscalePrinter" -o "$GrayscaleOption" 2>/dev/null
echo "Applied $GrayscaleOption to $GrayscalePrinter."
done
done
# Loop over every printer and disable printer sharing
echo "Disabling printer sharing..."
cupsctl --no-share-printers 2>/dev/null
echo "Global printer sharing disabled."
# Loop over individual printers and disable sharing
for DesiredPrinter in "${DesiredPrinters[@]}"
do
lpadmin -p $DesiredPrinter -o printer-is-shared=false
echo "Printer sharing disabled for $DesiredPrinter."
done
}
# --------------------- Housekeeping --------------------- #
# Remove unwanted or old printers
echo "Searching for and removing unwanted printers..."
for PrinterName in "${PrinterNames[@]}"
do
# test if the printer was found
lpstat -p "$PrinterName" >/dev/null 2>&1 # mute all output
status=$?
if [ $status -eq 0 ]; then
lpadmin -x "$PrinterName" 2>/dev/null
echo "Deleted $PrinterName"
fi
done
# Ensure Mobility Print has been removed
# Check if PaperCut is installed (otherwise will override PS3 driver on installed printers)
# This is a failsafe to ensure the PS3 driver is used
if [ -d "/Applications/PaperCut Mobility Print Client" ]; then
echo "PaperCut Mobility Client detected. Removing..."
rm -rf "/Applications/PaperCut Mobility Print Client"
echo "PaperCut Mobility Client deleted."
fi
# Check if desired printers were found
echo "Checking if desired printers are installed..."
allPrintersFound=true
for DesiredPrinter in "${DesiredPrinters[@]}"
do
lpstat -p "$DesiredPrinter" 2>/dev/null
status=$?
if [ $status -ne 0 ]; then
echo "Printer $DesiredPrinter not found."
allPrintersFound=false
fi
done
# Check if valid PPD file is found, else override the allPrintersFound variable
# this prevents attempted configuration without valid PPD file (error)
if [ ! -f "$PPD_PATH" ]; then
echo "PPD file not found. Skipping configuration..."
allPrintersFound=false
fi
if $allPrintersFound; then
# Configure the printers
echo "All desired printers found. Ensuring configuration is set..."
configure_printers
echo "Configuration complete."
# Print completion message
echo "Script complete. Exiting..."
exit 0
fi
# --------------------- Driver Installation --------------------- #
# Check if the PPD file exists
if [ ! -f "$PPD_PATH" ]; then
echo "PPD file not found. Driver will now be downloaded..."
# Download the driver
echo "Downloading driver..."
curl -L "$DRIVER_URL" -o "/tmp/$TEMP_PACKAGE_NAME" 2>/dev/null
# Install the driver
echo "Installing driver..."
installer -pkg "/tmp/$TEMP_PACKAGE_NAME" -target /
# Check if the PPD file exists
if [ ! -f "$PPD_PATH" ]; then
echo "PPD file still not found. Ensure your DRIVER_URL variable is set correctly and is reachable."
echo "Exiting script..."
exit 1
fi
else
echo "PPD file found. Continuing with installation."
fi
# --------------------- Printer Installation --------------------- #
# Create the desired printers from the list.
echo "Adding desired printers..."
for DesiredPrinter in "${DesiredPrinters[@]}"
do
lpadmin -p "$DesiredPrinter" -v "$SocketType$ServerIP$DesiredPrinter" -P "$PPD_PATH" -o printer-is-shared=false 2>/dev/null
echo "$DesiredPrinter created with lpadmin."
done
# --------------------- Verify Installation --------------------- #
# Check if the printers were installed
allPrintersFound=true
for DesiredPrinter in "${DesiredPrinters[@]}"
do
lpstat -p "$DesiredPrinter" 2>/dev/null
status=$?
if [ $status -ne 0 ]; then
echo "Printer $DesiredPrinter not found."
allPrintersFound=false
fi
done
if $allPrintersFound; then
echo "All desired printers added successfully."
else
echo "Not all desired printers found."
echo "Verify the printers are shared on the server and the names are correct."
echo "Exiting script..."
exit 1
fi
# --------------------- Printer Configuration --------------------- #
# Print configuring message
echo "Configuring printers..."
# Configure the printers
configure_printers
# Print completion message
echo "Printer configuration complete."
# --------------------- End --------------------- #
# Print completion message
echo "Script complete. Exiting..."
exit 0