Posted on 02-02-2015 12:33 PM
Hi,
We've got a few printers in our organization that we initially put in Self Service that were installed by most of our employees. Recently, some settings needed to be changed for the printers, so that they would go through a network share instead of a direct IP address. I've updated the printer in the policy (for Self Service), but now need a way to automate a remove and reinstall of the printers on the user's computers. What I've got so far is a really simple bash script to remove the printers:
lpadmin -x My_Printer1
lpadmin -x My_Printer2
lpadmin -x My_Printer3
My question is, is there a bash command I can append to the end of this script to launch the policy to install the printer again from Self Service? I'd be willing to try another approach if anyone was kind enough to offer one.
Thanks in advance.
Solved! Go to Solution.
Posted on 02-02-2015 12:44 PM
You can trigger policies from a script in a number of ways. They're all based on the 'jamf policy' command.
If you want to trigger one policy specifically (keep in mind it must be scoped to the computer and not disabled due to a date/time or non-Ongoing execution setting):
jamf policy -id ##
If you set a custom trigger and want to run all of the policies with that trigger configured:
jamf policy -trigger someTriggerHere
Run "sudo jamf help policy" in Terminal for specifics.
Posted on 02-02-2015 12:44 PM
You can trigger policies from a script in a number of ways. They're all based on the 'jamf policy' command.
If you want to trigger one policy specifically (keep in mind it must be scoped to the computer and not disabled due to a date/time or non-Ongoing execution setting):
jamf policy -id ##
If you set a custom trigger and want to run all of the policies with that trigger configured:
jamf policy -trigger someTriggerHere
Run "sudo jamf help policy" in Terminal for specifics.
Posted on 02-02-2015 01:02 PM
@bagdasd if you're already running a script to remove the printer(s), why not just let the script do the add as well instead of calling a JAMF policy?
Posted on 02-02-2015 01:06 PM
@bvrooman Thank you! You rock man!
Posted on 02-02-2015 01:08 PM
@stevewood Hi Steve, thanks for the reply. That's also a good option, but it seems like launching the policy would be easier than specifying all of the cups settings for 3 printers in a script.