helloYou981
helloYou981

Reputation: 33

Is there any posibility to delete multiple members of a group with microsoft graph?

In the official documentation there is an example to make a DELETE request in order to delete a member from a group. Here's the documentation - remove member

DELETE https://graph.microsoft.com/v1.0/groups/{group-id}/members/{directory-object-id}/$ref

So far from what i've found and tested, when adding an user to a group, you can add up to 20 users per request, into a group. add member

PATCH https://graph.microsoft.com/v1.0/groups/{group-id}
Content-type: application/json
Content-length: 30

{
  "[email protected]": [
    "https://graph.microsoft.com/v1.0/directoryObjects/{id}",
    "https://graph.microsoft.com/v1.0/directoryObjects/{id}",
    "https://graph.microsoft.com/v1.0/directoryObjects/{id}"
    ]
}

I was wondering if there is any possibility to remove multiple users from a group per request, or if you could remove 20 users at a time from a group, per request, like you can do when you're adding them into a group.

Upvotes: 1

Views: 1837

Answers (2)

Nathan Laigle
Nathan Laigle

Reputation: 1

You can combine multiple requests in one HTTP call using JSON batching (check here). But JSON batch requests are currently limited to 20 individual requests.

Upvotes: 0

Carl Zhao
Carl Zhao

Reputation: 9539

Unfortunately, after my test, you cannot delete multiple members in a group through Microsoft Graph, you can only delete a single member. You can make your suggestions here.

Upvotes: 2

Related Questions