How to Change Storage Quotas for Thousands of SharePoint Sites via PowerShell
Question details
The user needs to bulk update the storage limits and warning levels for thousands of SharePoint Online sites.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- A SharePoint Online administrator needs to automate the management of storage quotas across a large number of active sites.
- Observed behavior
- Updating quotas manually is impractical for thousands of sites, requiring an automated PowerShell solution using a CSV export.
Ensure you have the SharePoint Online Management Shell installed on your computer and possess SharePoint Administrator or Global Administrator privileges in your Microsoft 365 tenant.
Bulk Update SharePoint Site Storage Quotas using PowerShell and CSV
Automate the quota update process by exporting site URLs to a CSV file and running a PowerShell script to apply new storage limits.
By utilizing the SharePoint Admin Center and the SharePoint Online Management Shell, administrators can efficiently manage storage settings in bulk, saving time and preventing manual data entry errors.
Log in to the SharePoint Admin Center, navigate to the 'Active sites' page, and export the list of sites to a CSV file. Save this file to an accessible location, such as 'C:\users\admin\desktop\allsites.csv'.
Open the SharePoint Online Management Shell and authenticate your tenant by running the command: Connect-SPOService -Url https://<yourtenant>-admin.sharepoint.com.
Execute the following PowerShell command to read the CSV and apply the new quotas: Import-Csv C:\users\admin\desktop\allsites.csv | ForEach-Object { Set-SPOSite -Identity $_.URL -StorageQuota 1047552 -StorageQuotaWarningLevel 1000000 }. Adjust the file path and numerical values as needed.
Once the script completes, check a few sites in the SharePoint Admin Center to ensure the new storage limit and warning level have been successfully applied.

Looking for a Lightweight Office Suite Alternative?
While managing SharePoint requires specific Microsoft 365 admin tools, for daily document creation and team collaboration, WPS Office offers a free, lightweight, and highly compatible alternative to Microsoft Office. It seamlessly handles Word, Excel, and PowerPoint files without the heavy subscription costs.
- 1. Download and Install WPS Office: Visit the official WPS website, download the free installer, and complete the installation process in minutes.
- 2. Open Your Office Files: Launch WPS Office and directly open any existing Microsoft Word, Excel, or PowerPoint files with perfect formatting preservation.
- 3. Collaborate and Share: Use built-in cloud capabilities to edit documents and share them effortlessly with your team.

Frequently Asked Questions
Why is my Set-SPOSite command failing when updating the storage quota?
The command might fail if the specified warning level is higher than or equal to the maximum storage quota, or if you do not have sufficient administrator privileges. Ensure your warning level parameter is strictly lower than the -StorageQuota value.
How do I specify 1 TB as a storage quota in the PowerShell script?
Storage quotas in SharePoint PowerShell must be specified in megabytes (MB). To set a 1 TB quota, use 1048576 (which is 1024 * 1024 MB), or approximately 1047552 MB for 1023 GB.
What should I do if the PowerShell bulk update fails consistently?
If the script continues to fail despite correct syntax and valid administrative privileges, you may be hitting rate limits or backend synchronization issues. In this case, open a service request through the Microsoft 365 admin center.
Can I automate this without using a CSV file?
Yes, you can use the Get-SPOSite cmdlet to fetch sites dynamically based on specific criteria (like their template or current storage) and pipe those results directly into Set-SPOSite, bypassing the CSV export step entirely.




