How to increase SharePoint Storage limit using powershell

IBN 4,476 Reputation points
2021-12-23T12:36:54.407+00:00

Hello,

I would like to find out how to increase SharePoint storage limit manually on PowerShell.

Microsoft 365 and Office SharePoint Server For business
Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

Accepted answer
  1. Echo Du_MSFT 17,316 Reputation points
    2021-12-24T02:41:49.877+00:00

    Hello @IBN ,

    Please follow the steps:

    Step1: Change Tenant Storage Method. Please note, Storage Quota changes take effect only when the tenant storage method is manual.

    a. Navigation to the SharePoint admin center as a Global Administrator

    b. Settings >> SharePoint Site storage limits >> Manual

    160241-storage1.jpg

    Step2: Please run the below PowerShell to increase storage space as an admin.

    Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking  
       
    #Parameters  
    $AdminCenterURL="https://domain-admin.sharePoint.com"  
    $SiteURL = "https://domain.sharepoint.com/sites/sitename"  
      
    #Add 5 GB to the existing site  
    $QuotaIncrease = 5   
       
    #Setup Credentials to connect  
    Connect-SPOService -Url $AdminCenterURL -Credential (Get-Credential)  
             
    #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  
    

    160185-storage2.jpg

    160232-storage3.jpg

    160213-storage4.jpg

    Note: The maximum size of any Site collection is 25 TB! If the site collection size is already 25 TB, running this PowerShell command will report an error. For example:

    160233-storage5.jpg

    160234-storage6.jpg

    Thanks,
    Echo Du

    ======================================

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bruno Levi 6 Reputation points
    2022-11-01T13:57:00.053+00:00

    Hello, I found the problem, it seems that the "StorageQuota" property comes in TB and that value multiplied by 1024 is above the 25TB limit specified by Sharepoint itself. What I did was take the "StorageUsageCurrent" property and add it to the value of "QuotaIncrease", if my site has 31GB used, it will add up to 31,744 + 51,200 and the new quota will be 82,944 or 83GB. I also realized that it is necessary to specify the "StorageQuotaWariningLevel" and I developed this code:

    #Calcula 90% do espaço definido em Cota  
    $Cache = $NewStorage - (($NewStorage * 90)/100)  
    $Warn = $NewStorage - $Cache  
    

    So it will set for the "StorageQuotaWarningLevel" 90% of the total value of the site.

    Hope this helps.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.