![]() usr/bin/curl -sfku " $apiuser ": " $apipass " " $jssurl ":8443/JSSResource/commandflush/computers/id/ " $computerID "/status/Failed -X DELETEĬomputerID= $(/usr/bin/curl -u " $apiuser ": " $apipass " " $jssurl ":8443/JSSResource/computers/serialnumber/ " $serial " -H "accept: text/xml " | /usr/bin/xpath "/computer/general/id/text() " ) Serial= $(/usr/sbin/ioreg -rd1 -c IOPlatformExpertDevice | /usr/bin/awk -F '" ' '/IOPlatformSerialNumber/ ' ) ![]() Your API user just needs the following permissions: There are tools for obfuscating these credentials so you don’t have plaint text usernames and passwords in scripts on your server. If you’ve not used the Jamf Pro API before, in order to query your Jamf Pro server you’ll need to pass user credentials. This way we could both identify and clear any failed commands in one step, rather than having to create a separate policy for handling the removal. A big thanks to our machines update inventory once every day, I opted to modify the shared script to be used in an extension attribute. I had no prior API experience, but a fellow Mac admin was kind enough to share a script with me. Thankfully, Jamf has a commandflush API to remove all failed MDM commands given a device’s JSS ID. The problem with both of these methods is that it requires you to keep your eye on all of your profiles to monitor any failures and then clear them manually, either for all your machines or for a filtered subset. Running an inventory search, clicking the “Action” button, and choosing to clear management commands.Going to the individual device record, clicking the “Management” tab, and selecting the “Cancel All” button adjacent to the Failed Commands list.Jamf provides two manual ways of clearing these failures: Within the Jamf Pro web interface, you’ll see all these failures in the “Failed” column within computer Configuration Profiles. For one reason or another, configuration profiles will fail to install on macOS devices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |