How to get Group Membership count with Microsoft Graph API
Apparently it’s not that easy to get the amount of members of a group with the Microsoft Graph API. We need to specify the additional header
ConsistencyLevel: eventual to use the Advanced Query Capabilities. Then we can use the Query parameter
$count. Alternatively I found that I could also add it as an URL query parameter instead. That would be
Replace the Group ID (
02bd9fd6-8f93-4758-87c3-1fb73740a315) with your desired Azure Active Directory Group ID. Try the query in the Microsoft Graph Explorer here.
Or if you really only care about the count, you could just request the property
id. That will cause all other properties to get omitted. I found no way to just retrieve the count and no properties. Try the query in the Microsoft Graph Explorer here.