This is a common requirement often we come across to generate a report on how much storage allocated to each SharePoint online site collection and currently how much it consumed. This helps to in organizing the site collection, allocating storage and planning for the near future growth of the site collection size.
I had explained how to export Title and Url details of all SharePoint Online site collections present your tenant in my previous post Export SharePoint online site collection lists to file using PowerShell.
So you can execute till Connect-SPOService command as per my previous post. After that we would do a small modifications in the "select" to include StorageQuota, StorageQuotaWarningLevel,
StorageUsageCurrent as below.
$siteCollList = Get-SPOSite | select Title,Url,StorageQuota,StorageQuotaWarningLevel,StorageUsageCurrent
$siteCollList > D:\SPOSiteCollExport\SPOSiteCollDetails.txt
I had explained how to export Title and Url details of all SharePoint Online site collections present your tenant in my previous post Export SharePoint online site collection lists to file using PowerShell.
So you can execute till Connect-SPOService command as per my previous post. After that we would do a small modifications in the "select" to include StorageQuota, StorageQuotaWarningLevel,
StorageUsageCurrent as below.
$siteCollList = Get-SPOSite | select Title,Url,StorageQuota,StorageQuotaWarningLevel,StorageUsageCurrent
$siteCollList > D:\SPOSiteCollExport\SPOSiteCollDetails.txt
After successful execution it would generate the file with all properties mentioned in select.
We can also extend our scripting to export it to CSV so that it can be used in excel to prepare further representation in graph or so. Or even we can generate a html file with some formatting and color coding based on StorageQuota or StorageUsageCurrent etc.