Posted on 10-20-2015 04:37 AM
Hi All,
I need assistance with deploying a printer with the Uncheck Share Printer. I have done some of the suggestions mention on other posts such as:
https://jamfnation.jamfsoftware.com/featureRequest.html?id=1846
https://jamfnation.jamfsoftware.com/discussion.html?id=4174
https://jamfnation.jamfsoftware.com/discussion.html?id=11050
But not had any luck with the terminal commands. I have attached a screen shot of the policy I created. I would appreciate it if someone has input I can try.
Thanks in advance
Solved! Go to Solution.
Posted on 10-20-2015 06:07 AM
This script will disable printer sharing for all installed printers. Not exactly on deployment as you are asking, but you can run it after.
#!/bin/bash
osxVer=`/usr/bin/sw_vers | grep ProductVersion | cut -d: -f2`
minVer=`echo $osxVer | cut -d. -f2`
# start cupsd for os x 10.9+
if (( $minVer >= 9 )); then
/usr/sbin/cupsd
fi
# Disable print sharing
for i in `/usr/bin/find /etc/cups/ppd -type f -maxdepth 1 -name *.ppd | awk -F "/" '{print $5}' | cut -d "." -f1`; do
echo "Disabling Sharing on printer: ${i}"
/usr/sbin/lpadmin -p ${i} -P /private/etc/cups/ppd/${i}.ppd -o printer-is-shared=false
done
exit 0
Posted on 10-20-2015 06:07 AM
This script will disable printer sharing for all installed printers. Not exactly on deployment as you are asking, but you can run it after.
#!/bin/bash
osxVer=`/usr/bin/sw_vers | grep ProductVersion | cut -d: -f2`
minVer=`echo $osxVer | cut -d. -f2`
# start cupsd for os x 10.9+
if (( $minVer >= 9 )); then
/usr/sbin/cupsd
fi
# Disable print sharing
for i in `/usr/bin/find /etc/cups/ppd -type f -maxdepth 1 -name *.ppd | awk -F "/" '{print $5}' | cut -d "." -f1`; do
echo "Disabling Sharing on printer: ${i}"
/usr/sbin/lpadmin -p ${i} -P /private/etc/cups/ppd/${i}.ppd -o printer-is-shared=false
done
exit 0
Posted on 10-20-2015 06:50 AM
You may want to vote up this feature request: .
I generally use the following script in conjunction with my printer deployments so that I can disable printer sharing when the printer is deployed. NOTE: Many of my users do share a home printer so constantly disabling all of printer sharing doesn't work for me.
#!/bin/sh
/usr/sbin/lpadmin -p "$4" -o printer-is-shared="False"
I name parameter 4 in the script settings Printer Queue Name. Be sure that you are passing the script the printer device name either from CUPS (http://localhost:631) or from the Settings > General dialog box of the printer application.
Posted on 10-20-2015 06:53 AM
Your screenshot shows that you are disabling printer sharing on the print queue "RES-SAL-PRN-Red-Mac", but you are installing the print queue "RES_SAL_PRN_Red_Mac". If you update the script with the correct queue name, I think the command you are running will work just fine.
Posted on 10-20-2015 06:56 AM
I've got a script to disable printer sharing (similar to @nkoval's script) available from here:
Posted on 10-20-2015 08:43 AM
I can confirmed that running Todd Houles script has worked first time. Thank you very much.