Cloning Printer Setups in OSX

yurypanasyuk
New Contributor III

Hello Everyone,

Im looking for help on distributing printers via a script compiled as an application bundle (.app). We have office locations across the globe and my idea was that desktop support techs could create their own script for their respective locations or buildings. A tech would create the script by getting a new imaged machine and adding the desired printers and then copying the /etc/cups directory into the script below. Users normally would have to add the printers by IP manually but I would like to make it easier for users and techs alike. So far I have been doing it in my location (Canon printers) with great success but not sure if this is a good idea for other locations as I am not sure it will work with all types of networked printers? Are drivers stored the same way for all types of printers in the /etc/cups directory?

The script pretty much copies the /etc/cups directory found within the script and replaces it on the target machine. I would like to add some logic in eventually since the script replaces the cups directory therefore replacing any existing printers. Maybe this is a bad method. Any suggestions if so? Here is my script below. Thanks!

set theAlertText to "Printer Installation" set theAlertMessage to "This script will install printers to your maachine. Any current printers installed will be overwritten! Would you like to continue?" display alert theAlertText message theAlertMessage as critical buttons {"Don't Continue", "Continue"} default button "Continue" cancel button "Don't Continue" --> Result: {button returned:"Continue"} set thePathToTheSourceFolder to (POSIX path of (path to me)) & "Contents/Resources/Printers/" set theDestFolder to "/etc/cups" do shell script "rsync -avz --delete " & quoted form of thePathToTheSourceFolder & " " & quoted form of theDestFolder with administrator privileges tell application "Finder" display dialog "Script has completed successfully!" buttons {"Restart", "Cancel"} default button "Cancel" with icon caution if button returned of result is "Restart" then do shell script "(sleep 5 ; shutdown -r now) &>/dev/null &" with administrator privileges end if end tell
1 REPLY 1

stevevalle
Contributor III

If all your locations have network access and the Macs are connected to your JSS, you could use Self Service to deploy printers.

We use Self Service to deploy all printers across 3 different locations. This way all staff are able to install whatever printer they choose to without involving the help desk!

Each printer policy runs a "Check Printer Driver" script to determine if the driver is installed or not. If the drivers are not installed, another policy is kicked off to install the drivers, then the printer is mapped.