azure-active-directorypostmanmemberof

Is there a way to find out all users of a particular group in AzureAD?


So the usecase is that we need to retrieve only the users that are part of a certain AzureAD group.

As a test in postman, I ran this query: https://graph.microsoft.com/v1.0/users/{id}/transitiveMemberOf/microsoft.graph.group?$count=true&$orderby=displayName&$search="displayName:tier"&$select=displayName,id

however am getting the following message: Resource '{id}' does not exist or one of its queried reference-property objects are not present

Does anyone have any idea on whether this can be done? And how


Solution

  • You can use the List transitive members operation for a group: https://learn.microsoft.com/en-us/graph/api/group-list-transitivemembers?view=graph-rest-1.0&tabs=http.

    GET https://graph.microsoft.com/v1.0/groups/{id}/transitiveMembers
    

    Put the group's object ID in the URL.

    There is also an operation to get direct members, but that won't include users who are members of a group which is then a member of the group you are looking for.