cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

SharePoint site storage report

Is there any way to generate a report in Power automate which gets the SharePoint site storage used ?

3 REPLIES 3
annajhaveri
Community Champion
Community Champion

@Prathameshpatka  do you want to get site usage of one site collection or multiple site collections?

 

You can use REST API in Send HTTP Request to SharePoint action to get the usage:

annajhaveri_0-1625468079258.png

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

@annajhaveri 

 

I am looking to retrieve the site storage report of all the sites within a tenant

@Prathameshpatka  you can do following:

 

1. Add Send an HTTP request to SharePoint, in site address provide your SharePoint admin center site url, it will be in format: https://tenant-admin.sharepoint.com/ and configure the action as shown below 

annajhaveri_0-1625480916521.png

Provide URI as follows, this can get max 5000 sites from your tenant

_api/Web/Lists/GetbyTitle('DO_NOT_DELETE_SPLIST_TENANTADMIN_ALL_SITES_AGGREGATED_SITECOLLECTIONS')/Items?$select=Title,SiteId,SiteUrl&$filter=TemplateId ne 21&$top=5000

 

2. Then add parse json action, provide Body parameter from send http request action dynamic content, and generate from sample using below json

{
    "type": "object",
    "properties": {
        "d": {
            "type": "object",
            "properties": {
                "results": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "__metadata": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "uri": {
                                        "type": "string"
                                    },
                                    "etag": {
                                        "type": "string"
                                    },
                                    "type": {
                                        "type": "string"
                                    }
                                }
                            },
                            "Title": {
                                "type": "string"
                            },
                            "SiteId": {
                                "type": "string"
                            },
                            "SiteUrl": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "__metadata",
                            "Title",
                            "SiteId",
                            "SiteUrl"
                        ]
                    }
                },
                "__next": {
                    "type": "string"
                }
            }
        }
    }
}

 

3. Again add send http request to SharePoint action,  in site address parameter, select custom value from dropdown, which will open dynamic content, select the Site URL from dynamic content (this will automatically add apply to each action) and provide the Uri: _api/site/usage

 

annajhaveri_1-1625482331860.png

 

Then using output of site usage http action, you can create json array from this data and create HTML report

 

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,864)