What is the correct way to remove a member from a group using the Microsoft Graph .NET Client Library?
Adding a member can be done like this:
client.Groups["groupid"].Members.References.Request().AddAsync(objToAdd);
So i expected that there is something like:
client.Groups["groupid"].Members.References.Request().RemoveAsync(objToRemove);
The same question also applies to client.Groups["groupid"].Owners.References.
Try this way:
client.Groups["group_id"].Members["member_id"].Reference.Request().DeleteAsync();
The API to remove a member is:
DELETE /groups/<id>/members/<id>/$ref
The DirectoryObjectReferenceRequest.DeleteAsync() method will use DELETE method to send the request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With