Retrive programmatically SharePoint Online storage space

%3CLINGO-SUB%20id%3D%22lingo-sub-2043427%22%20slang%3D%22en-US%22%3ERetrive%20programmatically%20SharePoint%20Online%20storage%20space%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2043427%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHow%20can%20I%20retrieve%20programmatically%20SharePoint%20Online%20allocated%20(purchased)%20storage%20space%20of%20the%20whole%20tenant%2C%20which%20is%20visualized%20%22In%20the%20upper%20right%20of%20the%20page%22%3A%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22question-body%20post-body%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fmanage-site-collection-storage-limits%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fmanage-site-collection-storage-limits%3C%2FA%3E%3C%2FP%3E%3CP%3EIn%20report%20below%2C%20it%20is%20possible%20to%20retrieve%20used%20storage%20space%2C%20but%20not%20the%20allocated.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Freportroot-getsharepointsiteusagestorage%3Fview%3Dgraph-rest-beta%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Freportroot-getsharepointsiteusagestorage%3Fview%3Dgraph-rest-beta%3C%2FA%3E%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2043427%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2045233%22%20slang%3D%22en-US%22%3ERe%3A%20Retrive%20programmatically%20SharePoint%20Online%20storage%20space%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2045233%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F631014%22%20target%3D%22_blank%22%3E%40Oleksii_Kolinko%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20could%20try%20to%20use%20the%20PowerShell%26nbsp%3B%3CSPAN%3EGet-SPOSite%20with%20the%26nbsp%3B--StorageUsageCurrent%20parameter.%3CBR%20%2F%3E%3C%2FSPAN%3ERun%20it%20for%20all%20sites%20and%20calculate%20the%20total.%26nbsp%3B%3CBR%20%2F%3ENot%20sure%20if%20this%20would%20work%20in%20your%20case.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fsharepoint-online%2Fget-sposite%3Fview%3Dsharepoint-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGet-SPOSite%20(SharePointOnlinePowerShell)%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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-...

2 Replies

@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.

Get-SPOSite (SharePointOnlinePowerShell) | Microsoft Docs