Skip to main content
Solved

Get Computer Groups for Specific Site?


Forum|alt.badge.img+5

Hey Everybody,

I'm not seeing the option in the classic API, or maybe I'm missing the obvious, but is it possible to either get all the groups for a specific site, or query what site a group belongs to?  The default query grabs everything, but I'm only interested in groups for a specific site.

jamfGroupArray+=($(curl -sX GET -H "accept: application/xml" -H "Authorization: Bearer ${jssAuth}" "${jssURL}/JSSResource/mobiledevicegroups"))

Thanks again!

Best answer by mm2270

Hi there. There's actually another simple way to do what you're after. Just create an API account with Site access, to the specific Site you're interested in. Ensure the account can read the objects you want in the Privilege settings (or just make it a full Site admin) and when you use that account credentials in the API call, it will only display groups within that Site. By default a Site admin cannot pull up groups that aren't assigned to it, or are not global. This is true even when using the API.

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+5
  • Author
  • New Contributor
  • 6 replies
  • March 17, 2022

Found a workaround, though it involves the above and then querying each individual site in the result to see what site it belongs to.  Would be nice if there was an option to specify the site in the above CURL request.


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • Answer
  • March 21, 2022

Hi there. There's actually another simple way to do what you're after. Just create an API account with Site access, to the specific Site you're interested in. Ensure the account can read the objects you want in the Privilege settings (or just make it a full Site admin) and when you use that account credentials in the API call, it will only display groups within that Site. By default a Site admin cannot pull up groups that aren't assigned to it, or are not global. This is true even when using the API.


Forum|alt.badge.img+5
  • Author
  • New Contributor
  • 6 replies
  • March 21, 2022

Thanks m2270.  I'll check with our site admin to see if this can be done for me. 


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