Given a random package (either by ID number or name) in the JSS, I would like to get an output report of what policies in the JSS already contain said package.
That alone would be wicked cool, but I know some of the folks on here have push the API truly to the max..so I’ll issue a challenge...what I would really out and out LOVE is if I could take the output of the above and the ID number of a new package (already uploaded through Jamf Admin) add it to each of these policies and remove the old one.
I don’t have an answer, but I have a conceptual scheme of how it would work...
It would prompt the admin for the old version package ID that they want to replace. In my example we would target package 156, labeled “OldPackage.dmg”. It would then prompt the admin for the package ID of the new package, in this example, I would use package 257, labeled “ReplacementPackage.dmg”.
It would then loop through all policy IDs numbered 1-<a large max number>
For each policy that is set to install the old package, I would out replace the first snippet of the policy output below with the second snippet below
<package>
<id>156</id>
<name>OldPackage.dmg</name>
<action>Install</action>
<fut>false</fut>
<feu>false</feu>
<update_autorun>false</update_autorun></package>
<package>
<id>257</id>
<name>ReplacementPackage.dmg</name>
<action>Install</action>
<fut>false</fut>
<feu>false</feu>
<update_autorun>false</update_autorun>
</package>
It is assumed that multiple policies would have this particular package in it. It is also assumed that I want to leave everything else in policies alone.
This is a lot to take in so I understand if no one has the time to help me write crazy API scripts.
Any help given will be very much appreciated.
Blackholemac
