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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get a list of all site...
Power Automate
Answered

Get a list of all site & owners in a site collection in power automate

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I recently had a request to build a flow that iterates through all the sites in a site collection and returns the owner names of that the sites. Is this possible with Power Automate, If so, how would one going about doing that. I have scoured the verse and i get a lot of PowerShell options however i need to had this over to a compliance team and would like it automated so that they can just view a csv in a document library.

 

Any ideas would be welcome and appreciated.

 

Cheers!

DWTKBrook

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

    Hi @Anonymous,

     

    You can use an Send an HTTP request to SharePoint action for this. After that you can use the outputs in a Select and/or Create csv table action.

     

    Below is an example of that HTTP request.

     

    _api/web/webs/?$select=title,ServerRelativeUrl&$expand=SiteGroups/Users

     

    classicsubsites_retrievesubsites.png

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @Expiscornovus 

     

    Thank you for your suggestions, I attempted a simple manual flow to accomplish this (see below) but the HTTP request errored with Bad Gateway. I'm not really sure what this means.

     

    DWTKBrook_0-1677604370826.png

     

  • Expiscornovus Profile Picture
    33,970 Most Valuable Professional on at

    Hi @Anonymous,

     

    Have you selected the site collection from the site address dropdown? Or did you manually enter a custom value. The X at the end of the dropdown suggests that it cannot find your site address.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

     Hello @Expiscornovus ,  I did both, below is the image when selecting the site collection...

    DWTKBrook_1-1677609951339.png

    any ideas where I'm going wrong?

     

  • Expiscornovus Profile Picture
    33,970 Most Valuable Professional on at

    Hi @Anonymous,

     

    Just to double check that we are talking about the same thing. In your opening post you said: all the sites in a site collection.

     

    Are you talking about a site collection (classicsubsites) and all its related subsites (1012, 1444, etc.) like in my screenshot below? Or are you talking about something totally different? 😁

     

    retrievesubsites.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @Expiscornovus ,

     

    Thank you for your reply. Yes,  I am looking to find the owners of the sites and subsites with a site collection.

     

    Cheers!

    DWTKBrook

  • Expiscornovus Profile Picture
    33,970 Most Valuable Professional on at

    Hi @Anonymous,

     

    I didn't notice before, but I see you made a typo in the Accept Header.

     

    It should be

    application/json;odata=nometadata

     

    It looks like you used

    apllication/json;odata=nometadata

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Expiscornovus, thank you for the error spot. I have corrected it but alas, I still get a bad gateway error.

    DWTKBrook_0-1678118898463.png

    Cheers!

    DWTKBrook

  • Verified answer
    Expiscornovus Profile Picture
    33,970 Most Valuable Professional on at

    Hi @Anonymous,

     

    Can you share a screenshot of the subsites tab (can be found in site contents) of your site collection? Just to double check that you are using the correct site collection in the site address 🙂

     

    Does a different Uri work at all for the same site collection? Can you try the below for troubleshooting purposes?

    _api/web

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @Expiscornovus 

     

    I tried using _api/web and my tests were succeeding. Now on to making the output readable.

     

    Thank you @Expiscornovus 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard