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

fig : Microsoft 365 - SharePoint online - PowerShell - Know the storage properties of site collection
fig : Microsoft 365 - SharePoint online - PowerShell - Know the storage properties of site collection

Hi All,

Greetings for the day!!!

In last following couple of articles we are discussing SharePoint storage

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

    fig : Microsoft 365 - SharePoint online - PowerShell - Know the storage properties of site collection
    fig : Microsoft 365 – SharePoint online – PowerShell – Know the storage properties of site collection

    Thanks for reading. HAVE A FANTASTIC TIME!!! ENJOY BEAUTIFULE LIFE 🙂

    Prasham Sabadra

    LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

    You may also like...

    1 Response

    1. August 20, 2023

      […] Small Tips and Tricks – PowerShell – Microsoft 365 : SharePoint Online – Getting site collection storage details – https://knowledge-junction.in/2023/02/16/small-tips-and-tricks-powershell-microsoft-365-sharepoint-o&#8230; […]

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    %d bloggers like this: