OneDrive Error Codes

Set One User's OneDrive Storage Quota with PowerShell

Chanuka GeekiyanageChanuka Geekiyanage Nov 14, 2026 868 views

Question details

Set the storage quota for one user's OneDrive site when Set-SPOSite reports an error despite a valid URL and quota parameter.

Product
OneDrive for Business and SharePoint Online Management Shell
Device & OS
Windows
Scenario
An administrator uses PowerShell to change the storage quota for an individual OneDrive site.
Observed behavior
Set-SPOSite reports that the URL is a OneDrive for Business site collection, while Get-SPOSite can find the site.
Before you start

Have the user's OneDrive site URL, your SharePoint admin center URL, and an account with the appropriate SharePoint administrative permissions ready. Choose the quota in megabytes and check that it is permitted by your organization's OneDrive licensing and storage limits.

Solution 1Recommended

Verify the OneDrive URL and reinstall the SharePoint Online module

Use this approach when Get-SPOSite finds the user's site but Set-SPOSite still reports an error.

An outdated or damaged SharePoint Online Management Shell module can cause this error. Reinstalling the module may resolve it after you have checked the site URL.

1
Connect to SharePoint Online

Open Windows PowerShell and run Connect-SPOService -Url https://<tenant>-admin.sharepoint.com, replacing <tenant> with your organization name. Sign in with an account that has the appropriate administrative permissions.

2
Check the user's site

Set $URL to the user's full OneDrive site URL, then run Get-SPOSite -Identity $URL. Confirm that the returned site is the one whose quota you want to change.

3
Remove the existing module

Run Get-Module -ListAvailable Microsoft.Online.SharePoint.PowerShell to inspect installed versions. If the module was installed with PowerShellGet, close other PowerShell sessions and run Uninstall-Module -Name Microsoft.Online.SharePoint.PowerShell -AllVersions in an elevated PowerShell window. If it was installed as a management shell application, remove it through Windows Settings > Apps instead.

4
Install the current module

In PowerShell, run Install-Module -Name Microsoft.Online.SharePoint.PowerShell and follow any prompts. Open a new PowerShell session after installation.

5
Reconnect and set the quota

Run Connect-SPOService again, set $URL to the verified site URL and $quota to the desired value in megabytes, then run Set-SPOSite -Identity $URL -StorageQuota $quota. Check the result with Get-SPOSite -Identity $URL | Select-Object Url, StorageQuota.

Verify the OneDrive URL and reinstall the SharePoint Online module
Quota limits still apply: Reinstalling the module does not override your organization's OneDrive licensing or storage limits.
Free Microsoft Office alternative

Work with Office files in WPS Office

WPS Office is a free, lightweight alternative for editing documents, spreadsheets, and presentations. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files into WPS. It does not manage OneDrive storage quotas.

Open and edit files downloaded from OneDriveCompatible with Microsoft Office formats, including DOCX, XLSX, and PPTXUse a familiar interface for documents, spreadsheets, and presentationsWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

How can I check whether PowerShell can find the user's OneDrive site?

After connecting with Connect-SPOService, run Get-SPOSite -Identity $URL, where $URL contains the user's full OneDrive site URL.

What unit does the StorageQuota parameter use?

Set-SPOSite -StorageQuota accepts the quota in megabytes. Set $quota to the desired value before running the command.

How do I check the quota after changing it?

Run Get-SPOSite -Identity $URL | Select-Object Url, StorageQuota to display the site's URL and configured storage quota.

Why might reinstalling the module not resolve the error?

The site URL, administrative permissions, licensing, or storage limits may need attention. Verify the site with Get-SPOSite and check the user's applicable OneDrive storage limits before retrying Set-SPOSite.