How to fix it: SharePoint is unable to set the OneDrive storage quota for new users

In specific cases, SharePoint Online can fail to set or update the storage quota of a OneDrive.


The storage quota issue

You may first notice that a user’s OneDrive shows an incorrect storage quota and reports that no storage is used.

Default storage quota has not been updated
Default storage quota has not been updated

Next, you cannot change the storage. The system returns an internal server error.

The system has an issue updating the storage
The system has an issue updating the storage

You cannot update the storage via PowerShell either.

Set-SPOSite : An error was encountered while retrieving the user profile.
Storage quota reset is not working
Storage quota reset is not working

In the SharePoint User Profile, you will find a value of 0 in Personal Site Capabilities and a high number for Personal Site Instantiation State. SharePoint is unable to complete the initial provisioning of the OneDrive site.

SharePoint User Profile Service
SharePoint User Profile Service

With PnP PowerShell, you will find an error indicating that SharePoint cannot set the initial storage quota because the user account is missing.

Failed to set quota using RefreshPersonalSiteQuota. Microsoft.Office.Server.UserProfiles.UserNotFoundException: An error was encountered while retrieving the user profile. 
OneDrive provisioning issues
OneDrive provisioning issues
Root cause

The root cause is a recreated Entra ID or synced Active Directory account with a reused UserPrincipalName. This can happen if an employee leaves the organisation and returns several months later, while the original SharePoint user profile and OneDrive are still in the deletion phase.

SharePoint can have problems with internal user IDs when a UserPrincipalName is reused, meaning it is not unique across the user’s entire lifetime, particularly when an employee leaves and then returns.

Microsoft prepared a page about that issue:

These issues usually occur if a user account is deleted from the Microsoft 365 admin center, and then a new account is created by using the user principal name (UPN) that was used by the deleted account. The new account is assigned a new ID value even though the UPN is the same. However, the UserInfo list for the SharePoint and OneDrive sites that’s associated with the account has only the old ID. When users try to access a SharePoint site or their OneDrive site by using their new account, their new ID doesn’t match the ID that’s in the UserInfo list. Therefore, they’re denied access to the site.

These issues might also occur during directory synchronization between an Active Directory organizational unit (OU) and SharePoint. If users have already logged in to SharePoint and are later moved to a different OU, they might experience these issues when the OU synchronizes with SharePoint.

Microsoft also provides a useful self-help diagnostics page for known OneDrive and SharePoint issues.
You will find a “OneDrive storage quota” diagnostic which runs “Diag: OneDrive Storage Quota” in the Microsoft 365 Admin Center support section.

Paste the affected UserPrincipalName and give the system a minute to analyse the account. Diag will inform you that the internal user ID between the user account and the connected OneDrive does not match, and asks whether it should fix the mismatch.

Run a Diag fix
Run a Diag fix

At this stage, the user cannot access their OneDrive and has no files stored in it. They receive an “access denied” message, even though they are the owner of the OneDrive. You must correct the ID mismatch.


How Diag fixes the issue?

It’s not a special fix. A SharePoint admin can do the same manually. It requires more effort than clicking “Update”. I recommend using the Diag fix, as it is much faster.

Diag removes the old user ID from the OneDrive site collection and sets the new account as the owner. The complete removal of the previous ID is the important part.
You cannot simply remove the owner from a OneDrive site collection, as the owner is also the primary site collection admin. The site collection requires an alternative account. However, if you do not remove the old ID, SharePoint will always use this user because the item already exists in the User Hidden List (also known as User Information List).

You can easily verify the Diag support fix with PnP PowerShell.
Connect to the OneDrive site collection and check the user information list entry for the updated account, including the item ID and creation date.

PowerShell
$UPN = "<UserPrincipalNameFromTheAffectedAccount>"
$OneDriveUrl = "<OneDriveUrlFromTheAffectedAccount>"

# You should have an Azure app to connect with PnP PowerShell
Connect-PnPOnline -ClientId "<YourAzureAppId>" -Interactive -Url $OneDriveUrl

# Getting the User Information list from the site
$UserInformationList = Get-PnPList | ?{$_.ListItemEntityTypeFullName -eq "SP.Data.UserInfoItem" }

# Getting the user item from the list
$UserItem = (Get-PnPListItem -List $UserInformationList).FieldValues | ?{$_.Name -like "*$UPN" }
$UserItem.GetEnumerator() | Where-Object { $_.Key -in @("ID","Name","Created") }

  1. The ID is the latest and highest number.
  2. The account was added to the list today. The Diag support tool removed the old account and re-added the new account.

Similar to my sample.

PowerShell

Now try resetting the storage quota again. It is working.

Quota reset is now working
Quota reset is now working

The same when you change the OneDrive storage in the Microsoft 365 Admin Center. No more system error.

Storage changes are working
Storage changes are now working

The Purview Audit Logs will list all the activities.

Kusto
OfficeActivity
| where TimeGenerated between (datetime(2025-11-18 10:00:00) .. datetime(2025-11-18 11:00:00))
| where OfficeObjectId == "<OneDriveUrlFromTheAffectedAccount>"

Purview Audit Logs (reduced for privacy reasons)
Purview Audit Logs (reduced for privacy reasons)
Additional notes

This account may also encounter additional SharePoint permission issues when content was previously shared and then shared again with the new account. SharePoint will always use the existing entry in the User Information List, even when it belongs to an outdated user. You should plan a full SharePoint clean-up for the previous (now new) account.

Share
Avatar photo

Tobias Asböck

Tobias is a Senior System Engineer with more than 10 years of professional experience with Microsoft 365 products such as SharePoint Online, SharePoint Premium, OneDrive for Business, Teams Collaboration, Entra ID, Information Protection, Universal Print, and Microsoft 365 Licensing. He also has 15+ years of experience planning, administering, and operating SharePoint Server environments. Tobias is a PowerShell Scripter with certifications for Microsoft 365 products. In his spare time, Tobias is busy with updates in the Microsoft 365 world or on the road with his road bike and other sports activities. If you have additional questions, please contact me via LinkedIn or [email protected].

Leave a Reply

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