Posted on 03-16-2022 10:55 AM
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!
Solved! Go to Solution.
Posted on 03-21-2022 06:34 AM
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.
Posted on 03-17-2022 09:52 AM
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.
Posted on 03-21-2022 06:34 AM
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.
Posted on 03-21-2022 07:34 AM
Thanks m2270. I'll check with our site admin to see if this can be done for me.