Canon Uniflow username prompt

rpayne
Contributor II

I'm attempting to deploy Canon's Uniflow follow me printing service. Adding the print driver is easy enough and I can map the printer and add it via jamf admin. The issue I'm having is that the "URL" of the printer (LPD/LPR) is unique for each user as it includes their username. The URL is like this: lpd://<username>@xxxxxxxxxx/PrintAnywhere where I'd like <username> , to be their actual username.

We are currently not bound to any directory service and have not deployed Connect yet (Azure AD). The local user account usernames are the same as their AD username.

My question is this, what is the cleanest way to inject or replace the LDP address with their custom url that includes their username? Canon has been no help and I'll be honest in the fact that I'm not a scripting whiz.

11 REPLIES 11

mm2270
Legendary Contributor III

Will the primary users of the Mac be logged into those devices when the script runs? If so, the following code will get their shortname/username, which you can then place back into the command, I assume. I don't have experience with this Canon printing service myself, so I'm just guessing on the last part.

logged_in_user=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/&&!/loginwindow/{print $3}')

So, depending on how you are adding those print URLs during the deployment, if it's being scripted, you would just place that logged_in_user variable into the mix, like so

lpd://${logged_in_user}@123.45.678/PrintAnywhere

Again, I can't test the above, so I have no idea for sure if that would work, but give it a try and see.

rpayne
Contributor II

Yes they will be. Thank you. I'll get to testing with some scripts built around this

rskolden
New Contributor III

I have been configuring this before and what @mm2270 is suggesting is the way to go.
Just note that your printing system probably read usernames from the AD (if you don't use a local DB), and that means that the local username needs to match the AD username.

So depending on your environment I would say go with one of the following:
- Read local username
- Read AD username from a source that you have available (EC, NoMAD, JC)
- Prompt the user to enter their AD username (I used this for BYOD scenarios)

Chris_Hafner
Valued Contributor II

This is a project that may be on my plate in December. We will pull creds from EC, while prepping for Connect as you are. Glad you folks are already discussing it!

bradtchapman
Valued Contributor II

We are a Canon Uniflow shop and our script checks that the printer drivers are installed first (you should not use generic PostScript, but rather Canon's UFR II CUPS drivers). Then it uses a similar technique as @mm2270 to add the printer...

/usr/sbin/lpadmin -p "$lpqueue" -E -v lpd://${username}@${printServer} -m "$printerModel" -o printer-is-shared=false

lpqueue = the printer queue path, like "SecurePrint-Mac"
username = self-explanatory, pulled from local
printServer = the FQDN of the Uniflow print server
printerModel = the path to the print drivers

In this example, documents would be sent for 'bradtchapman' to a Uniflow secure print queue, using the print driver for the Canon ImageRunner Advance C5550, and the 'share printer' option is turned off in the Printers preference pane (reduces Bonjour traffic, prevents excessive duplicates appearing on other Macs)

lpd://bradtchapman@uniflow-la-001.pretendco.com -m "/Library/Printers/PPDs/Contents/Resources/CNMCIRAC5550S2.ppd.gz" -o printer-is-shared false"

Alternatively, if the computer is assigned in Jamf to a user's short name, you can pull the 'username' from the Jamf computer record via API in your script.

GabeShack
Valued Contributor III

can i ask a bit more about this.  We are just setting up uniflow cloud hosted.  We created the installer per the nice instructions by another jamf user repackaging the Smart Client for uniflow to actually install.  The regular package installs the "secure print" driver as "UniFlow Online 2020" with no default options listed.  Are you saying to edit the driver it uses from the UNiflow one to the canon specific driver?  This "driver" is supposed to be "universal" (notice all the quotes) but we are seeing it cannot default things to say black and white only or 2 sided.

Gabe Shackney
Princeton Public Schools

bradtchapman
Valued Contributor II

If you're looking at Uniflow drivers with a specific year next to them, you're looking at either the server-side "universal" driver package for Windows, or the Uniflow application itself.  The universal drivers are only for Windows clients.  Printers shared from a server can be auto-configured for Windows clients if the shared printer has drivers selected.

For Mac clients, you will need the PPD or UFRII drivers for Mac.  Choose a printer model that is most common in your fleet of multifunction copier/printers. For instance, the imageRUNNER C5550.  You'd download those drivers, keep them in the .pkg format as delivered, and deploy them en masse to your Macs ahead of time. 

When you're ready to configure a Uniflow Secure Printer queue, use the lpadmin command above.  Wrap it in a nice script with a GUI if you're feeling up to it.

 

box
New Contributor III

Apologies for bringing up an old post, but I am trying to setup Canon Secure Print as well. 

If the login username differs from the user logon on AD, is it pretty much not possible to setup? 

Thank you, 

bradtchapman
Valued Contributor II

Hi @box ,

prior to our implementation of Automated Device Enrollment, wherein we require authentication—this sets the user affinity for the Mac in Jamf and creates a matching local account / home folder—sometimes local user names would not match the active directory user name of the assignee.  In this scenario, we have an in-house script in Self Service that prompts the user for their Active Directory username.  Granted, there's no way to validate it ... but if they aren't careful and end up sending print jobs to johndoe instead of johndoe1, they simply won't be able to retrieve them.  All they need to do is run the script again and set the secure printer using the correct username.  

We built ours around Pashua (now defunct) but you can absolutely use SwiftDialog.  

box
New Contributor III

Thank you for the reply. 

The account I am using matches the AD naming conv. 

I installed all drivers and yet unable to add Secure Print on MacOS.

Is there something on the UniFlow side that needs to be done? 

Hello there. In order to get this to work, you will need to enable the LPD service if you are using an on-premise Printserver. Wasn't sure if you had mentioned that.