How to Automate Google Cloud Print Printer Sharing
on 19 August 2020 11:44 PM
Up until recently the only automated task in our Google Cloud Print integration was PaperCut’s publishing of the printers to GCP. Admins would then have to manually share many tens or hundreds of GCP printers to many hundreds or thousands of users. Even if an admin distills the cohorts of students, faculty, and staff to a relative few groups within one’s G Suite domain group list, this is still a huge drag. However, we have invested some effort in working out the steps to automate the sharing of GCP printers, and I will describe that here:
Automating the sharing and management of Google Cloud Print printers requires setting yourself up with the open source command line tool, Google Apps Manager. GAM requires that you authenticate it with one of your domain’s Super Admin accounts. The setup process will also initialize a personalized instance of GAM on Google Cloud Platform. The free license of Google Cloud Platform should support the GAM needs of most organizations. A subscription to Google Cloud Platform is not required. GAM’s Git Hub wiki has simple instructions for downloading, installing and starting to use it here: https://github.com/jay0lee/GAM/wiki.
Once your GAM project is up and running, the next step in the printer sharing automation process is to collect your organization’s list of groups and printer IDs since those are the attributes the command to share a printer requires.
This command writes to a CSV file the list of printers owned or accessible by the user GAM is running as:
This command writes to a CSV file all the groups in the domain:
Next, open a new spreadsheet document in either Excel or Google Sheets and call it “Commands.” Open
The Commands sheet’s column A should still be blank because this is the column our formula will populate with all of the commands required to share every printer with every group.
Below is the formula that will list all possible command combinations of each printer ID and user group. Copy and paste it into cell A2.
Next, select and copy cell A2 and paste the formula into the rows below. All possible printer and email command combinations will be listed based on the two list values, like so:
Then, copy and paste cells A2 through the end of the column into a new text file.
Save it as
In macOS and Linux:
Save it as
Depending on the number of printers and groups, this may take a while. Sharing this way will not send users a printer sharing notification, they will just appear on their list of available printers.