Home > Jamf Pro, Jamf Pro Classic API, Scripting > Updating management status in Jamf Pro computer inventory records on Jamf Pro 10.49.0 and later
As of Jamf Pro 10.49.0, the following mass action has been removed:
I had been using this to update the status of unmanaged Macs to now be managed Macs, by editing the username and password assigned to the computer inventory record. As part of this, the remote management status of the computer inventory record would change from Unmanaged to Managed.
As of Jamf Pro 10.49.0, the management account information has been removed from the computer inventory record, with the resulting removal of the mass-action to edit the management account information. However, this has left me without a mass-action to change unmanaged Macs to managed Macs.
Fortunately, there’s a way to change this via the Jamf Pro Classic API. The relevant API command to change the management status in a Jamf Pro computer inventory record should look like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It’s sending the following XML block to update the relevant computer inventory record and make the management change:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<computer> | |
<general> | |
<remote_management> | |
<managed>true</managed> | |
</remote_management> | |
</general> | |
</computer> |
Previously, you also needed to send along the management username and management password, but since those have been removed as of Jamf Pro 10.49.0, those are no longer needed.
I have filed a feature request with Jamf to get back an equivalent mass-action to update the management status. For those interested, it is the following:
JN-I-27551: https://ideas.jamf.com/ideas/JN-I-27551
While I wait to see what Jamf does with the feature request, I was able to use the API information discussed above to create a script which a) updates the management status in specified computer inventory records and b) generates a report of the Macs whose computer inventory records were updated. For more details, please see below the jump.
The script is named Set_Jamf_Pro_Computers_To_Managed_Status.sh and is available via the link below:
The script is designed to take in a set of Jamf Pro ID numbers in a plaintext file, where the Jamf Pro ID numbers correspond the Macs where you want to change the management status in their Jamf Pro computer inventory records. The plaintext file should look similar to this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
416462 | |
842736 | |
434703 | |
338517 | |
481915 | |
596669 |
Five items are required to use this script:
Jamf Pro account privileges required by the Jamf Pro server account referenced above:
Jamf Pro Server Objects:
Computers: Read, Update
Users: Update
Once the five specified items are available, the script can be run using the following command:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You should see output like this:
As part of the script’s run, a report will be generated and you’ll be notified of where it is stored. The report will be in TSV format and appear similar to what’s shown below: