Is there any way to generate a report in Power automate which gets the SharePoint site storage used ?
@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:
@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
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
Then using output of site usage http action, you can create json array from this data and create HTML report
User | Count |
---|---|
88 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
122 | |
54 | |
37 | |
24 | |
21 |