Updating management status in Jamf Pro computer inventory records on Jamf Pro 10.49.0 and later
2023-8-15 23:39:57 Author: derflounder.wordpress.com(查看原文) 阅读量:19 收藏

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

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:

  •  Edit the Management Account Information

Screen Shot 2021 09 28 at 10 39 53 AM

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:


It’s sending the following XML block to update the relevant computer inventory record and make the management change:


<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:

https://github.com/rtrouton/rtrouton_scripts/tree/main/rtrouton_scripts/Casper_Scripts/Set_Jamf_Pro_Computers_To_Managed

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:


416462
842736
434703
338517
481915
596669

Five items are required to use this script:

  • Jamf Pro 10.49.0 or later
  • A text file containing the Jamf Pro IDs of the computer(s) you wish to delete.
  • The URL of the appropriate Jamf Pro server.
  • The username of an account on the Jamf Pro server with sufficient privileges to delete computers from the Jamf Pro server.
  • The password for the relevant account on the Jamf Pro server.

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:


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:


文章来源: https://derflounder.wordpress.com/2023/08/15/updating-management-status-in-jamf-pro-computer-inventory-records-on-jamf-pro-10-49-0-and-later/
如有侵权请联系:admin#unsafe.sh