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
Best answer by thoule
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
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.
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.
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.