Small Tips and Tricks – PowerShell – Microsoft 365 : SharePoint Online – Getting site collection storage details

Hi All,
Greetings for the day!!!
In last following couple of articles we are discussing SharePoint storage
- Small Tips and Tricks – Microsoft 365 : SharePoint Online – Know the total storage / space allocated and used storage for my organization – from SharePoint admin center
- Small Tips and Tricks – Microsoft 365 : SharePoint Online – Managing site storage limit – from SharePoint admin center
- Small Tips and Tricks – Microsoft 365 : SharePoint Online – Know the total storage / space allocated and used storage for my organization – from PowerShell
Today one more PowerShell script – getting site collection storage details using PowerShell
Background / Use Case
- In our organization we need to make consistent allocation of the quota / storage / space for our SharePoint site collections
- We also need to make storage configuration consistent across our organization. This means when new site created default consistent storage, consistent warning level, either to notify admin or not
- This task came to me so the research and sharing. SHARING IS CARING 🙂
Storage properties of Site Collection
Following are the storage properties associated with Site Collection
- StorageQuota – Total storage quota allocated to the Site Collection
- StorageQuotaWarningLevel – What is the value set for warning level – so that Site owner / Administrator can notified and appropriate action can be taken.This will prevent from site getting locked.
- StorageUsageCurrent – How much MB storage is used by current site collection
All these properties return values in MB.
Detailed steps
- Connect to our Microsoft 365 tenant using – Connect-SPOService with our SharePoint admin site URL
Connect-SPOService -Url <SharePoint admin site URL>
Connect-SPOService -Url https://knowledgejunction1-admin.sharepoint.com
- Once we are connected to Microsoft 365, next step is get our site collection details using – Get-SPOSite
Get-SPOSite -Identity <SiteCollection URL>
$site = Get-SPOSite -Identity https://knoweldgejunction1.sharepoint.com
- Onec we have Get-SPOSite CMDLET executed successfully, we are able to get the details using storage related properties
$site.StorageQuota
$site.StorageQuotaWarningLevel
$site.StorageUsageCurrent

Thanks for reading. HAVE A FANTASTIC TIME!!! ENJOY BEAUTIFULE LIFE 🙂
You must log in to post a comment.