Forum Discussion
PatrickF11
Jul 11, 2019MCT
dynamic group based on assigned license
Hi, is it possible to create a group with users based on a assigned license? So i want to include all users into this specific group who has e.g. an E3 license assigned, but not an E5. It se...
Steven-H
Apr 03, 2020Brass Contributor
You can do this using the following advanced rule
(user.assignedPlans -any (assignedPlan.servicePlanId -eq "<servicePlanId>" -and assignedPlan.capabilityStatus -eq "Enabled"))
You can lookup service plan ids by using the Graph Explorer and looking at licenseDetails on a user that has the desired license assigned.
https://graph.microsoft.com/v1.0/users/someperson@yourdomain.tld/licenseDetails
Look in the resulting output for the specific thing to key off.
Links
https://developer.microsoft.com/en-us/graph/graph-explorer
https://docs.microsoft.com/en-us/graph/api/user-list-licensedetails?view=graph-rest-1.0&tabs=http
PatrickF11
Apr 08, 2020MCT
Hi Steven-H
Thanks for your reply, this is nearly the same of what i'm using at the moment.
(Except that u use the id and not the name.)
Edit: I didn't think about the approach via the graph, thank you 🙂