
I fount the answer:
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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://learn.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.
Hi
You can use Get-SPOTenant which will return a property called StorageQuota.
Docs article here.
Hope this helps!
Martin
Try below PowerShell.
#Config Parameters
$AdminSiteURL="https://testLZ-admin.sharepoint.com"
$ReportOutput="C:\Temp\SPOStorage.csv"
#Get Credentials to connect to SharePoint Admin Center
$Cred = Get-Credential
#Connect to SharePoint Online Admin Center
Connect-SPOService -Url $AdminSiteURL –Credential $Cred
#Get all Site collections
$SiteCollections = Get-SPOSite -Limit All
Write-Host "Total Number of Site collections Found:"$SiteCollections.count -f Yellow
#Array to store Result
$ResultSet = @()
Foreach($Site in $SiteCollections)
{
Write-Host "Processing Site Collection :"$Site.URL -f Yellow
#Send the Result to CSV
$Result = new-object PSObject
$Result| add-member -membertype NoteProperty -name "SiteURL" -Value $Site.URL
$Result | add-member -membertype NoteProperty -name "Allocated" -Value $Site.StorageQuota
$Result | add-member -membertype NoteProperty -name "Used" -Value $Site.StorageUsageCurrent
$Result | add-member -membertype NoteProperty -name "Warning Level" -Value $site.StorageQuotaWarningLevel
$ResultSet += $Result
}
#Export Result to csv file
$ResultSet | Export-Csv $ReportOutput -notypeinformation
Write-Host "Site Quota Report Generated Successfully!" -f Green
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.