Microsoft Graph: a list of all users and their groups in one query

I would like to list all users. For each user, I need to display the roles and groups specific to that user.

I tried:

https://graph.microsoft.com/v1.0/users?$expand=memberOf

But it gives exactly the same result as:

https://graph.microsoft.com/v1.0/users

According to the document for the user object ( http://graph.microsoft.io/en-us/docs/api-reference/v1.0/resources/user ), I should be able to list the roles and groups for the user by using the relation memberOf.

I can get the roles and groups that I need for each user by running one query for each user (using https://graph.microsoft.com/v1.0/users/{user_id}/getMemberObjects), but it's a little slow and iterating over.

What am I missing?

+4
1

Microsoft Graph (v1.0). -.

:

https://graph.microsoft.com/beta/users?$expand=memberOf

, - 1.0 .

3 API- Microsoft.

-

- , , .

memberOf , .

https://graph.microsoft.com/v1.0/users/{id}/memberOf

https://graph.microsoft.com/v1.0/users/{user_id}/getMemberObjects

v1.0 , , -. .

https://graph.microsoft.com/v1.0/groups/?$expand=members
+4

Source: https://habr.com/ru/post/1651595/


All Articles