Get recursive/transitive membership via the Graph API

%3CLINGO-SUB%20id%3D%22lingo-sub-290219%22%20slang%3D%22en-US%22%3EGet%20recursive%2Ftransitive%20membership%20via%20the%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-290219%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20new%20and%20useful%20-%20you%20can%20now%20get%20a%20list%20of%20all%20groups%20a%20given%20user%20is%20a%20member%20of%20via%20a%20single%20query%3A%3C%2FP%3E%0A%3CPRE%3E%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fusers%2Fvasil%40michev.info%2FtransitiveMemberOf%22%3C%2FPRE%3E%0A%3CP%3ESimilarly%2C%20you%20can%20list%20all%20members%20of%20a%20group%2C%20including%20members%20of%20any%20nested%20groups%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fgroups%2Fc91cd116-a8a5-443b-9ae1-e1f0bade4a23%2FtransitiveMembers%22%3C%2FPRE%3E%0A%3CP%3EOnly%20downside%20is%20that%20it%20only%20covers%20objects%20the%20Graph%2FAzure%20AD%20is%20aware%20about%2C%20for%20example%20no%20Dynamic%20distribution%20groups.%20Anyway%2C%20check%20the%20documentation%20for%20more%20info%3A%20%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fapi%2Fgroup_list_transitivemembers%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fapi%2Fgroup_list_transitivemembers%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-290219%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
MVP

This is new and useful - you can now get a list of all groups a given user is a member of via a single query:

"https://graph.microsoft.com/beta/users/vasil@michev.info/transitiveMemberOf"

Similarly, you can list all members of a group, including members of any nested groups:

 

"https://graph.microsoft.com/beta/groups/c91cd116-a8a5-443b-9ae1-e1f0bade4a23/transitiveMembers"

Only downside is that it only covers objects the Graph/Azure AD is aware about, for example no Dynamic distribution groups. Anyway, check the documentation for more info: https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/group_list_transitivemembers

 

0 Replies