Printer Kung Fu

tempizzle
New Contributor

Hi guys. This is my first post on here. I wanted to see if there is a good solution for what I'm trying to do.

My company has 14 different buildings, each with their owner printers.

Is there an elegant way to clear out a staff members printing system and then re-add all of the printers in one step?

1 ACCEPTED SOLUTION

stevewood
Honored Contributor II
Honored Contributor II

If you are removing every printer from the system, effectively reseting the printing system, you can use the following brute force method in a before script to do this:

#!/bin/sh
# remove all printers
rm -rf /etc/cups/printers.conf

# restart cups
killall cupsd

exit 0

As far as adding printers back in, you can scope the printers in a policy by subnet. You'd probably need one policy per subnet. The policy would run that before script to kill the conf file, and then add the appropriate printers back to the systems.

HTH

View solution in original post

5 REPLIES 5

hkim
Contributor II

Do each of the buildings have there own network segment?

tempizzle
New Contributor

Yes. We also setup distro-points at each building that sync with our Jamf master server.

stevewood
Honored Contributor II
Honored Contributor II

If you are removing every printer from the system, effectively reseting the printing system, you can use the following brute force method in a before script to do this:

#!/bin/sh
# remove all printers
rm -rf /etc/cups/printers.conf

# restart cups
killall cupsd

exit 0

As far as adding printers back in, you can scope the printers in a policy by subnet. You'd probably need one policy per subnet. The policy would run that before script to kill the conf file, and then add the appropriate printers back to the systems.

HTH

acdesigntech
Contributor II

For good measure, I also issue an```
rm -r /etc/cups/ppds/*
```

tempizzle
New Contributor

Thanks guys!