SharePoint Online: Change Storage Quota of a Site Collection using PowerShell

Requirement: Increase storage quota in SharePoint Online using PowerShell.

How to set the storage quota of a site collection in SharePoint Online?

By default, SharePoint Online uses an automatic storage quota management from the storage pool allocated to the tenant to reduce administrator efforts. However, you can take over the storage management and adjust site quotas for each collection. To set the storage quota of a SharePoint site collection, follow these steps:

  1. Login to your SharePoint Online Admin Center (https://<tenant>-admin.sharepoint.com).
  2. Expand “Sites” >> Click on “Active Sites” in the left navigation.
  3. Select the site collection to set its storage limit. Click on the “Storage” button on the toolbar. (You’ll see the “Storage” option in the toolbar only when the storage management option is set to “Manual”! More on setting storage management options in SharePoint Online is here: Office 365: Managing Site Storage Limits in SharePoint Online)
  4. This brings the “Edit storage limit” panel to set the storage limit for the selected site collection. Enter a maximum storage value in GB. Say, You want to allocate 10 TB of storage space to a site collection. Enter “10240”. You can also set the warning threshold for the site owners to get notified when it reaches the threshold value.
    sharepoint online change storage quota

Increase Site Storage Quota in Classic Admin Center:

If you use a classic admin center, click the “Site Collections” link in the left navigation. Select the target site collection from the available site collections to change the storage quota, and click on the “Storage Quota” button from the ribbon.

sharepoint online change storage quota

Enter the new quota for your site collection from the storage quota page. You can optionally enable Email notifications to the site administrators when storage reaches a particular threshold.

sharepoint online set storage quota

Click on “Save” to apply the new storage quota to your SharePoint Online site.

How to Change storage quota using PowerShell in SharePoint Online?

To set storage quota in SharePoint Online, use the Set-SPOSite cmdlet. Here is how to increase storage quota in SharePoint Online using PowerShell:

Step 1: Connect to SharePoint Online as SharePoint Online Administrator or Tenant Admin

$AdminURL="https://crescent-admin.sharepoint.com"
Connect-SPOService -URL $AdminURL -Credentials (Get-Credential) 

Step 2: Change the storage quota with Set-SPOSite cmdlet.

$SiteURL="https://crescent.sharepoint.com/sites/marketing"
#Set Storage Quota
Set-SPOSite -Identity $SiteURL -StorageQuota 2048

It takes a while to execute and sets the storage quota of the given site collection to 2GB. You can verify the new storage quota from the Admin site.

sharepoint online increase storage quota powershell

Set Storage Quota for a Site using PnP PowerShell:

Let’s set the storage limit for a site collection to 10 GB using PnP PowerShell.

#Set Parameters
$TenantAdminURL = "https://Crescent-admin.sharepoint.com"
$SiteURL = "https://Crescent.sharepoint.com/sites/Sales"

#Connect to SharePoint Admin Center
Connect-PnPOnline -Url $TenantAdminURL -Interactive

#set storage quota for the site in MBs
Set-PnPTenantSite -Url $SiteURL -StorageWarningLevel 8192 -StorageMaximumLevel 10240

How to Increase Storage Quota for All Site Collections?
Here is the PowerShell to set quota in SharePoint Online:

#Get all the site collection
$AllSites = Get-SPOSite -Limit All

#Set Storage quota for each site collection
Foreach ($Site in $AllSites)
{
   #set quota on sharepoint online site powershell
   Set-SPOSite -Identity $Site.URL -StorageQuota 10000 -StorageQuotaWarningLevel 8000
}

This script blindly sets all site collection’s storage quota to 10 GB. If you are running a storage space shortage, you can buy additional storage for your subscription.

Increase storage space in SharePoint Online

How about increasing the existing quota by a specific storage space? E.g., Add 5 GB to the existing site?

Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking

#Parameters
$AdminCenterURL="https://Crescent-Admin.SharePoint.com"
$SiteURL = "https://Crescent.SharePoint.com/sites/marketing"
$QuotaIncrease = 5 #5 GB

#Setup Credentials to connect
$Cred = Get-Credential

Connect-SPOService -Url $AdminCenterURL -Credential $Cred
      
#Get the Site Collection
$Site = Get-SPOSite -Identity $SiteURL -Detailed

#Calculate New Storage Quota
$CurrentStorage = $Site.StorageQuota
$NewStorage = $CurrentStorage + ($QuotaIncrease * 1024)

#increase storage quota in sharepoint online
Set-SPOSite -Identity $SiteURL -StorageQuota $NewStorage
Write-Host "Storage Quota set from '$CurrentStorage' to '$NewStorage'" -f Green

Please note, these quota changes take effect only when the tenant storage method is manual! Here is another post on generating storage quota reports in SharePoint Online: SharePoint Online: Get Site Storage Quota Report using PowerShell

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. Passionate about sharing the deep technical knowledge and experience to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *