Our company has one app that we must defer updates for, and it absolutely cannot be allowed to update during normal hours. We keep automatic updates off and have a script for pushing updates for this app overnight. Recently I had to rewrite this script due to endpoints being deprecated, and it ended up being a bit of a pain. So, I decided now might be a good time to provide some insight here in hope that someone experiencing the same situation might stumble upon this.
The workflow that works with the new endpoints is:
wait until scheduled time (and wait between most of these steps) > get necessary device info > send restart command to devices > change app setting to force updates > send INSTALLED_APPLICATION_LIST command to devices > send blank push to devices > revert app setting
However, there is a catch. You may want to use the “/api/v2/mobile-device-groups/static-group-membership/” endpoint to get the Management IDs for devices. Currently, this endpoint has a bug and returns most of the device info as null (known Jamf issue: PI119893). Our company is fairly small so our solution was to just use “/api/v2/mobile-devices/” to get the IDs, however that requires sending an individual request for every single device you want to scope.
If you want to look at or use our script it is here:
github.com/Professor-Raptor/jamf
