

- JAMF PRO API INSTALL
- JAMF PRO API SERIAL
- JAMF PRO API UPDATE
- JAMF PRO API MANUAL
- JAMF PRO API REGISTRATION
JAMF PRO API UPDATE
Lastly, the EA will output whether it removed any failed MDM commands as part of the machine’s last inventory update or if no failures existed. (If you’re interested, you’ll find response examples for each API here: ) Using grep, we determine if the failed node is empty or not, and if failed commands exist will then trigger a commandflush for the machine.

Normally, if any failed MDM commands exist then you would see tags in your response, but if no failed MDM commands exist then this is empty, producing a tag. Because the API doesn’t allow you to filter these commands to just those that are failures, we pass the results to xpath whereby we can gather only the XML nodes we care about.
JAMF PRO API SERIAL
"Īfter collecting the local machine serial number, it queries the Jamf Pro Server via the computerhistory API to read the MDM commands for the given machine. bin/echo "Removing failed MDM commands … " # Clear failed MDM commands if they exist Parseresult= $(/bin/echo " $xmlresult " | /usr/bin/grep " " ) These actions can be deleting objects in Jamf Pro, reading inventory information, updating policies, etc The possibilities are endless. # An empty failed XML node will look like this: The Jamf Pro API can be utilized to perform actions on your Jamf Pro server in mass without having to log into the GUI to get it done. Xmlresult= $(/usr/bin/curl -sfku " $apiuser ": " $apipass " " $jssurl ":8443/JSSResource/computerhistory/serialnumber/ " $serial "/subset/Commands -X GET -H "accept: application/xml " | /usr/bin/xpath "/computer_history/commands/failed " ) 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. Automate triage, classify, and assign service tickets using AI. AI can automatically resolve 40 of all tickets instantly.

Turn messy Slack IT support channels into a convenient service desk. 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. 4 per user per month See Software atSpoke is your ticket for a faster, better service desk. 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.
JAMF PRO API MANUAL
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.
JAMF PRO API INSTALL
Request Token by sending a POST to /v1/auth/token.For one reason or another, configuration profiles will fail to install on macOS devices.The steps to generate a token and use it are as follows:
JAMF PRO API REGISTRATION
A POST command to the /v1/auth/keep-alive endpoint will use a valid token to generate a new token with a new 30 minute validity period and will invalidate the previous token. The Default Jamf Pro Device Registration page - Depending on the state of the macOS device. But not yet received email, even i checked in Junk folder. This means that Jamf Pro API leverages the same User Accounts and Groups functionality of Jamf Pro as the Classic API, but uses a token-based authentication scheme.īy default this generated token will remain valid for 30 minutes. Posted on 02-18-2021 08:37 PM I am new to Jamf Pro API. Our Jamf API supports Bearer Token authorization. Now, how do we authorize the action we want to perform? With the Classic API, we can simply pass our username and password in our curl command. These actions can be deleting objects in Jamf Pro, reading inventory information, updating policies, etc… The possibilities are endless.Įach action performed with the Jamf Pro API requires an authorized user to carry out that action. The Jamf Pro API can be utilized to perform actions on your Jamf Pro server in mass without having to log into the GUI to get it done.
