we are using the following query to get the list of all the members in a group
https://graph.microsoft.com/v1.0/groups/{id}/members
requirement
- We need to get all the users in a group and also the count of the groups each users belongs too in a single call, so that we dont delete users who are part of multiple groups.
couldn’t find any information on searching on multiple entities (group and user).
2
Answers
Make use of below code to get all the users in a group and also the count of the groups each users belongs too in a single call:
With a single query, you can retrieve users members of a specific group and expand groups where the user is a member of.
Counting must be done on the client
If you prefer the Microsoft Graph .NET SDK