Posted on 10-04-2018 02:47 PM
Is there any way to turn off printer sharing via Jamf Pro? In the os, I see two ways one might go about it:
I have not found a way to do the first, and the second one seems to be turned on by default by the OS.
Hopefully, one or the other is possible!
Posted on 10-04-2018 03:44 PM
When we push printer installs we include a command like lpadmin -p PrinterName -o printer-is-shared="False".
Posted on 10-04-2018 05:34 PM
That's an interesting idea, and I played around with it. My Printer is named "Office Copier" but when I issue the command:
- lpadmin -p "Office Copier" -o printer-is-shared="False"
I get the error:
- Printer name can only contain printable characters
So in order for this to even have a shot at working I'd need to have weird printer names like Office_Copier, or OfficeCopier.
Posted on 10-04-2018 08:28 PM
Run Unix command 'cupsctl --no-share-printers'
Posted on 10-05-2018 02:26 AM
I think if you write it as:
lpadmin -p 'Office Copier' -o printer-is-shared="False"
# Or
lpadmin -p Office Copier -o printer-is-shared="False"
# You might also want to look at how the system is saving it as you could edit the generated ppd...
ls /private/etc/cups/ppd
It should work.
Posted on 10-05-2018 01:07 PM
@B-35405 You got my hopes up. Sadly, that command seems to have no effect on either global printer sharing, or printer specific sharing. At least if it does all the boxes are still checked in the Sys Pref windows.
Posted on 10-05-2018 01:20 PM
Check what the device name is, not just the printer name. For example, we use Server-Dept-Function for the Printer name but the device name in the printer settings on the mac is actually Server_Dept_Function.
Posted on 10-05-2018 01:49 PM
This will do it for all printers:
#!/bin/bash
printers=$(lpstat -v | sed 's/://' | awk '{print $3}')
if [[ -n $printers ]]; then
/bin/echo "Printers found..."
for printer in $printers; do
lpadmin -p "$printer" -o printer-is-shared=False
/bin/echo "Disabled printer sharing for $printer."
done
/bin/echo "Restarting CUPS service..."
launchctl stop org.cups.cupsd
launchctl start org.cups.cupsd
/bin/echo "Done"
else
/bin/echo "No printers found, exiting..."
fi
exit 0