Forum Discussion

Oleksii_Kolinko's avatar
Oleksii_Kolinko
Copper Contributor
Jan 08, 2021

Retrive programmatically SharePoint Online storage space

How can I retrieve programmatically SharePoint Online allocated (purchased) storage space of the whole tenant, which is visualized "In the upper right of the page":

https://docs.microsoft.com/en-us/sharepoint/manage-site-collection-storage-limits

In report below, it is possible to retrieve used storage space, but not the allocated.

https://docs.microsoft.com/en-us/graph/api/reportroot-getsharepointsiteusagestorage?view=graph-rest-beta

2 Replies

  • Oleksii_Kolinko's avatar
    Oleksii_Kolinko
    Copper Contributor

    Oleksii_Kolinko I found the answer:

     

    https://sharepointnomad.wordpress.com/2020/06/29/office-365-storage-utilization-alerts-with-a-power-automate-workflow/

  • istvanybema's avatar
    istvanybema
    Brass Contributor

    Oleksii_Kolinko 

    You could try to use the PowerShell Get-SPOSite with the --StorageUsageCurrent parameter.
    Run it for all sites and calculate the total. 
    Not sure if this would work in your case.

    https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/get-sposite?view=sharepoint-ps

Resources