To get list of all members that associated to 5 different AD groups using Group name

Ashifa T 20 Reputation points
2023-10-05T19:44:21.5533333+00:00

Hi All,

Our application has 10 different AD groups and members are mapped under each AD group. Now
I have a scenario to retrieve the list of all members/users information that are associated to 5 different AD groups based on their group name or group Id.

Is there any way to get this list of all users from the different Azure AD Group with a single rest api call ?

Regards,
Ashifa.T

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,058 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,263 questions
0 comments No comments
{count} votes

Accepted answer
  1. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,491 Reputation points
    2023-10-06T01:14:50.1133333+00:00

    Hello @Ashifa T , in order to obtain all members from n groups in one call to the Microsoft Graph API you can use the $filter and $expand query parameters like this:

    GET https://graph.microsoft.com/v1.0/groups?$filter=id+in+('string','string',...)&$select=id&$expand=members
    

    Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.