I am trying to use PowerAutomate to remove user from SharePoint Goup, but it throw 401.
It works if I add user to group, but failed with remove condition
I am trying to use PowerAutomate to remove user from SharePoint Goup, but it throw 401.
It works if I add user to group, but failed with remove condition
Hi @Meekou
Firstly, check if you have the necessary privileges to remove the user from the SP group. If you have then you may try removing the user from group using email as show below:
_api/web/sitegroups/GetById(5)/users/getbyemail('<email address of user>')
{
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-HTTP-Method": "DELETE"
}
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
Thanks