Hi!
What is the correct way to remove the site collection admin automatically (its not me, but another admin).
This only removes from the Owners group:
Thanks @Expiscornovus ! The first option worked, the second one which have been better is not running trough just "working", after couple of minutes I have cancelled the workflow.
Hi @PRobi,
Do you want to remove the user from the site? Or do you just want to remove the assigned site collection admin role? Those are two different use cases 😁
Lets assume you only want to remove the role and keep the user. In that case try to set the IsSiteAdmin flag of the user.
Below is an example
URI
_api/web/getuserbyid(10)
Headers
{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"If-Match": "*",
"X-HTTP-Method": "MERGE"
}
Body
{
"__metadata":{ "type": "SP.User" },
"IsSiteAdmin": false
}
However, if you want to remove the user, you can use the below instead.
_api/web/siteusers/removebyid(10)
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1