Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

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

(0) ShareShare
ReportReport
Posted on by

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

  • Community Power Platform Member Profile Picture
    on at
    Re: Get a list of all site & owners in a site collection in power automate

    Hello @Expiscornovus 

     

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

     

    Thank you @Expiscornovus 

  • Verified answer
    Expiscornovus Profile Picture
    31,732 Most Valuable Professional on at
    Re: Get a list of all site & owners in a site collection in power automate

    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
    on at
    Re: Get a list of all site & owners in a site collection in power automate

    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

  • Expiscornovus Profile Picture
    31,732 Most Valuable Professional on at
    Re: Get a list of all site & owners in a site collection in power automate

    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
    on at
    Re: Get a list of all site & owners in a site collection in power automate

    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
    31,732 Most Valuable Professional on at
    Re: Get a list of all site & owners in a site collection in power automate

    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
    on at
    Re: Get a list of all site & owners in a site collection in power automate

     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
    31,732 Most Valuable Professional on at
    Re: Get a list of all site & owners in a site collection in power automate

    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
    on at
    Re: Get a list of all site & owners in a site collection in power automate

    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
    31,732 Most Valuable Professional on at
    Re: Get a list of all site & owners in a site collection in power automate

    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

     

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >