Using the Jamf Pro API to delete computers from Jamf Pro
嗯,用户让我帮忙总结一下这篇文章的内容,控制在100个字以内,而且不需要用“文章内容总结”或者“这篇文章”这样的开头。首先,我需要仔细阅读文章,抓住主要信息。 文章主要讲的是如何使用Jamf Pro API删除计算机记录。作者提到了一个脚本,可以删除指定的计算机,并生成报告。脚本的使用需要Jamf Pro的URL、用户名和密码,以及相应的权限。此外,还提到了支持API客户端认证的版本。 接下来,我要把这些要点浓缩到100字以内。确保涵盖API功能、脚本的作用、所需信息和权限,以及认证方式。同时,语言要简洁明了。 可能的结构是:介绍使用API删除计算机的方法,提到脚本的功能和所需条件,最后提到认证方式。这样既全面又简洁。 最后检查一下字数,确保不超过限制,并且表达清晰。 </think> 文章介绍了如何通过 Jamf Pro API 删除计算机记录,并提供了一个名为 Delete_Computers_From_Jamf_Pro.sh 的脚本。该脚本可删除指定 Jamf Pro ID 对应的计算机,并生成 TSV 格式的报告。使用脚本需提供 Jamf Pro 服务器 URL、用户名、密码及相应权限(Computers: Read, Delete)。同时支持 API 客户端认证方式。 2026-2-28 18:21:50 Author: derflounder.wordpress.com(查看原文) 阅读量:3 收藏

Home > Jamf Pro, Jamf Pro API, Scripting > Using the Jamf Pro API to delete computers from Jamf Pro

Using the Jamf Pro API to delete computers from Jamf Pro

Every so often, I need to delete one or multiple computers from a Jamf Pro server. This can be accomplished in the Jamf Pro admin console, but it can also be accomplished via the Jamf Pro API’s computers-inventory API endpoint. For more details, please see below the jump.

The API command to delete a computer inventory record from a Jamf Pro server should look similar to this:


I was able to use the API information discussed above to create a script which:

  1. Deletes specified computer inventory records.
  2. Generates a report of the Macs whose computer inventory records were deleted.

The script is named Delete_Computers_From_Jamf_Pro.sh and is available via the link below:

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

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 you want to delete. The script can also accept one Jamf Pro ID number as input, if a plaintext file containing Jamf Pro ID numbers is not available.

Three items are required to use these scripts:

  • 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, Delete

If you want to delete multiple computers at once from Jamf Pro, you will also need to provide a plaintext file containing the Jamf Pro IDs of the computer you wish to delete. The plaintext file should look similar to this:


416462
842736
434703
338517
481915
596669

Once the specified items are available, the scripts can be run using the following commands:

To use Delete_Computers_From_Jamf_Pro.sh to delete one computer:


/path/to/Delete_Computers_From_Jamf_Pro.sh

To use Delete_Computers_From_Jamf_Pro.sh to delete multiple computers:


/path/to/Delete_Computers_From_Jamf_Pro.sh /path/to/plaintext_filename_here.txt

When using Delete_Computers_From_Jamf_Pro.sh to delete one computer, you should see output that looks 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:

When using Delete_Computers_From_Jamf_Pro.sh to delete multiple computers, you should see output that looks like this:

The corresponding report will appear similar to what’s shown below:

In addition to the scripts described above which use user accounts for authentication, there are also matching scripts which use API client authentication available on GitHub via the links above. If setting up an API client with limited rights, here are the required API role privileges for the API client on the Jamf Pro server:

  • Computers Read
  • Computers Delete

文章来源: https://derflounder.wordpress.com/2026/02/28/using-the-jamf-pro-api-to-delete-computers-from-jamf-pro/
如有侵权请联系:admin#unsafe.sh