I have a list of Groups IDs, which include; Security Groups, Mail-Enabled Security group, Distribution lists, Office 365 groups.
now i have a user email and the user ID. and i want to remove the user from all the groups:-
I tried using Graph API:-
and using the built-in Remove Member from group:-
but both raised the same error, on distribution lists and mail-enabled groups:-
Cannot Update a mail-enabled security groups and or distribution list.
"error": {
"code": "Request_BadRequest",
"message": "Cannot Update a mail-enabled security groups and or distribution list.",
}
any advice how to remove those members?