Posted on 05-29-2015 02:23 AM
Hi All
how to remove current printers installed in macs, and deploy new ones into macs
thanks
Posted on 05-29-2015 03:12 AM
To remove all printers:
#!/bin/sh
for printer in `lpstat -p | awk '{print $2}'`
do
echo Deleting $printer
lpadmin -x $printer
done
Posted on 05-29-2015 06:03 AM
@jonnydford Hi Jonny
thanks for your script, i know this is perfect for removing all the current printer. but in this case, i need to deploy another policy to add the new printers after i delete them by using your script. so it's gonna be funny for some of the clients that fall into a circle of adding and deleting printers.
so what i prefer is put all the actions of removing the current and adding the new into single script. that would be perfect to me.
u have any idea?
Posted on 05-29-2015 06:22 AM
@Dalmatian create a policy that runs the script 'before' and then adds the printers. You can set the policy to run once, or at reboot ongoing, etc
Posted on 05-29-2015 06:27 AM
Posted on 05-29-2015 06:29 AM
If you deployed the prior printers via the JSS, you can keep the prior ones in your deployment policy, but select "unmap" to remove the specific printers which you want to remove. In the same policy you can "map" the new printers.
Posted on 05-29-2015 06:29 AM
add the script to casper admin. In the script properties, make sure it's set to priority before.
add the printers you want to add to casper admin
set up a new policy in JSS.
add the script, add the printers, set scope and when/how often you want it to run. We do this same workflow for all of our student laptops in carts, etc.
Posted on 05-29-2015 08:48 AM
It depends how you plan to deploy new printers, but we use a script to do it.
Assuming the driver is already on the Macs then at the end of the script you can add something like:
lpadmin -p NAME_OF_PRINTER -E -v lpd://ip.ad.dre.ss -P /Library/Printers/PPDs/Contents/Resources/driverpath.gz"