Forum Discussion
dynamic group based on assigned license
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
- PatrickF11Apr 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 🙂
- shathawayNov 17, 2021Copper Contributor
I was wondering if you have found a solution to creating a dynamic group based on license. I am looking to the do the same.
Thank you,
Steve
- D6BoostDec 02, 2021Copper Contributor
This expression appears to be working for me
(user.assignedPlans -all (assignedPlan.service -ne "Unassigned" -and assignedPlan.capabilityStatus -eq "Enabled"))
To use the expression builder :
Set the Property to: assignedPlans
Set the Operator to: all
Set the Value to: (assignedPlan.service -ne "Unassigned" -and assignedPlan.capabilityStatus -eq "Enabled")