Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

get all sharepoint users from all sharepoint sites

(0) ShareShare
ReportReport
Posted on by 4

Hello,

how can I retrieve a list of all Sharepoint sites with the correct users that have permission to the Sharepoint sites?

I can retrieve the users for one site, but I don't know how to loop through all Sharepoint sites.

 

 Screenshot 2023-02-01 165348.png

can somebody please help me 

  • Alyssableize101 Profile Picture
    4 on at
    Re: get all sharepoint users from all sharepoint sites

    Hi @v-xiaochen-msft ,

    I think your API call is fine, but you need to be Sharepoint Administrator. 

    Otherwise the run is going to fail. 

    So I figured out that with this API call, I can get all Sharepoint sites with all the "site owners" and "created by". 
    I also need all role assigments from all user (see the second picture)
    I don't know how to loop through all Sharepoint sites, Sharepoint users and the RoleAssignments. 

    Do you know how to do this?

     

    Alyssableize101_0-1675764763049.pngAlyssableize101_1-1675764880170.png

     

     

  • v-xiaochen-msft Profile Picture
    on at
    Re: get all sharepoint users from all sharepoint sites

    Hi @Alyssableize101 ,

     

    Which action in Flow calls the API you provided in your reply? I used the Api you provided but it failed.

     

    vxiaochenmsft_0-1675389142682.png

     

    Best Regards,

    Wearsky

  • Alyssableize101 Profile Picture
    4 on at
    Re: get all sharepoint users from all sharepoint sites

    Hi @v-xiaochen-msft 
    Thanx for your response!
    I looked at your link, but I think I found a easier solution. 

    I used the https:// [name}-admin.sharepoint.com, where I add the Site Address. 
    Now I can loop through all Sharepoint sites, but now I need to loop through all Sharepoint sites and then another for each loop through all Sharepoint users. 
    So one step closer, but not there yet

  • v-xiaochen-msft Profile Picture
    on at
    Re: get all sharepoint users from all sharepoint sites

    Hi @Alyssableize101 ,

     

    Please take a look at this post.

    https://stackoverflow.com/questions/51616560/sharepoint-get-all-sites-and-all-sub-sites-using-sharepoint-online-rest-api

     

    I believe it will list all the sites you have access to.

     

    Best Regards,

    Wearsky

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,011 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow