2
votes

In the Groups section of the Office 365 admin center, you can create and manage these types of groups:

  • Office 365 Groups (aka Unified Groups)
  • Security Groups
  • Mail enabled security groups
  • Distribution lists

Office 365 groups can not have nested groups in them. But it turns out all the other groups can be nested in each other.

Nested group: If I have a security group called GroupA. GroupA can have members which are either users or other groups. GroupB is what I am calling a 'nested group' if it is a member of GroupA.

I need to have possibility to be able to detect all members of given group. I can use this Microsoft Graph endpoint to get the list of the group's direct members. As Microsoft documentation states

A group can have users, contacts, and other groups as members. This operation is not transitive.

I can recursively traverse all members of current group and all nested groups, nested groups of these nested groups and so on. But I would like to omit this approach because it would be slow and useless.

Maybe there is an option or query parameter to "expand" groups and get all direct and indirect members of it or something like that?

Thanks in advance.

1

1 Answers

0
votes

You can use transitive members api to get all members in a given group.