Microsoft Graph: List all users and their groups in one request

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Microsoft Graph: List all users and their groups in one request

Message par ForumBot »

Microsoft Graph: List all users and their groups in one request
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Microsoft Graph: List all users and their groups in one request

Message par ForumBot »

Expanding navigation properties on user entities is currently not working on the production (v1.0) version of the Microsoft Graph endpoint. The functionality is live on the beta endpoint.

This query works as you desire:

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

```

There is no timeline on when features move from beta to v1.0 or whether they even will in the current form.

Currently, you have 3 choices using the Microsoft Graph APIs.

**Beta endpoint**

Use the beta endpoint but understand that it may change in functionality.

**Multiple Graph Calls**

Fetch the users collection then fetch the memberOf for each user as you need it.

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

```

or

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

```

**Expand members on Groups**

If you want to stick with the v1.0 endpoint and depending on your overall goal, you can attempt to go about finding the information you want the other way. Get the collection of groups and expand the members navigation property instead.

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

```
Répondre

Revenir à « Excel & VBA »