Skip to main content
Question

Getting a count of systems in a computer group


Forum|alt.badge.img+9

I am trying to determine which of our policies and profiles are assigned and how. I have a script that pulls all of the API data that I need as CSVs. So now I have a list of them and what they are assigned to, but what I really need is to start tracking down ones that aren't really used anymore. To do that, I would like to get a count of systems that are in the groups. Does anyone have a means of doing a data dump via API or SQL a list of groups and count of systems in those groups.

3 replies

Forum|alt.badge.img+9
  • Contributor
  • 29 replies
  • December 31, 2019

Just to clarify, are you looking to get a list of all smart / static computer groups and the number of devices within those groups?


Forum|alt.badge.img+9
  • Author
  • Contributor
  • 39 replies
  • December 31, 2019

Yeah that is basically it.


Forum|alt.badge.img+9
  • Contributor
  • 29 replies
  • December 31, 2019

You'll probably want to do this in two steps:

  1. Query the API to get the id number (or name) of all the computer groups. You can do this by using the API Query: /JSSResource/computergroups . It should return a list of all computer groups listing their name and ID number.

  2. Loop through each ID from the above list and query each computer group independently (via API Query: /JSSResource/computergroups/id/<id number>. What you're looking for is the <size> tag (under the parent tag of <computers>) which will contain the number of computers associated with that group.

Hopefully this helps!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings