Wouldn't it be better to detect the OS the Mac is on in the main removal script and then call the appropriate policy by it's trigger. Meaning, name each policy with an appropriate different name, like "InstallThing_10.11" and "InstallThing_10.12" or whatever. Then in the script that does your removal, check to see if the OS is below or at 10.12 and higher and run the correct policy.
Sounds like a good idea, I'm just not very good at scripts and custom triggers seemed an easier way. I'll look into it
Well, you would still be using custom triggers, just slightly different ones depending on the OS version. Here's an example of what I mean.
#!/bin/bash
ElCapTrigger="InstallProduct_10.11"
SierraTrigger="InstallProduct_10.12"
OSVers=$(sw_vers -productVersion | cut -d. -f2)
if [ "$OSVers" -lt 12 ]; then
TRIGGER="$ElCapTrigger"
else
TRIGGER="$SierraTrigger"
fi
/usr/local/bin/jamf policy -event "$TRIGGER"
You would just need to put the proper custom trigger names in for those 2 items at the top, and make sure they match the correct policy triggers that should be called. The script would check if the OS is lower than "12", meaning under 10.12.x, and run the older version, or if not, run the newer one.
Make sense?
The only thing is, this is a standalone script. You would need to see how to integrate these items into your software removal script. Shouldn't be hard to add this in somewhere.
Thank you. I managed to find a few test machines and my way didn't work.
The software got removed and the new software installed, but as there was a policy that was called but didn't run then jamf never reported back that the first one had work so everything just hung.
If you are scoping to different machines isn't just two independent work flows... and have two triggers too!!
Create one for the .11 machines then clone everything and then set it up for the .12 machines
yes it's more policies and scripts but it's easier...and much easier to troubleshoot
C