SharePoint Online: Change Storage Quota of 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 on each site collection. To set storage quota of a SharePoint site collection, Follow these steps:
  • Login to your SharePoint Online Admin Center (https://<tenant>-admin.sharepoint.com)
  • Expand "Sites" >> Click on "Active Sites" in the left navigation.
  • Select the site collection to set its storage limit. Click on the "Storage" button the toolbar. (You'll see the "Storage" option in the toolbar only when the storage management option is set to "Manual"!)
  • 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 storage space to a site collection, enter "10240". You can set the warning threshold as well 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 are using classic admin center, Click on "Site Collections" link in left navigation. From the available site collections, Select the target site collection to change storage quota,  Click on "Storage Quota" button from the ribbon.
sharepoint online change storage quota

From the storage quota page, enter the new quota for your site collection. You can optionally enable Email notification to the site administrators when storage reaches a particular threshold.
sharepoint online set storage quota

Click on "Save" to commit apply 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: Set-SPOSite cmdlet. Here is how to increase storage quota in SharePoint Online using PowerShell:

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

Step 2: Change storage quota with Set-SPOSite cmdlet.
$SiteURL="https://crescent.sharepoint.com/sites/marketing"
#Set Storage Quota
Set-SPOSite -Identity $SiteURL -StorageQuota 2000
It takes a while to execute, and 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:
Lets set storage limit for a site collection to 10GB using PnP PowerShell.
#Set Parameters
$TenantAdminURL = "https://crescentintranet-admin.sharepoint.com"
$SiteURL = "https://crescentintranet.sharepoint.com/sites/Sales"

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

#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-SPOSite -Identity $Site.URL -StorageQuota 10000 -StorageQuotaWarningLevel 8000
}

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.