web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove Site Collection...
Power Automate
Unanswered

Remove Site Collection admin

(0) ShareShare
ReportReport
Posted on by 5

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: 

PRobi_0-1708011114383.png

 

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    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
     }

     

    issiteadmin_false.png

     

    However, if you want to remove the user, you can use the below instead.

     

    _api/web/siteusers/removebyid(10)

     

    removefromsiteusers.png

  • PRobi Profile Picture
    5 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard