About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
A user whose account was deleted and then created again with the same username gets "Access denied", an inconsistent experience, a OneDrive address with a number or GUID on the end, or this message: "There is a legacy user account in this site with same email. Please ask site owner or administrator to remove the legacy user account from this site." Microsoft's fix is the Site User Mismatch diagnostic in the Microsoft 365 admin center, run by a SharePoint administrator. For OneDrive sites, Microsoft says administrators cannot fix this by changing the site owners or editing profile properties by hand.
What the error means
A SharePoint or OneDrive site keeps its own list of known users, the UserInfo list. Each entry holds the user's ID. Microsoft's page explains that when an account is deleted and a new one is created with the same user principal name (UPN), "The new account is assigned a new ID value even though the UPN is the same." The UserInfo list still holds only the old ID, so the new ID does not match and the user is denied.
The page names two ways to reach the same state:
- A user account is deleted from the Microsoft 365 admin center and a new account is created with the old UPN.
- Directory synchronisation between an Active Directory organizational unit (OU) and SharePoint, when users who have already signed in to SharePoint are later moved to a different OU.
A OneDrive site is not deleted the moment its account is. So the new account gets a new OneDrive site whose address is the old one plus a suffix such as 1 or a GUID. That is why a user can see a second, empty OneDrive while the files remain on the original.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Account deleted, then recreated with the same UPN | "Access denied"; a OneDrive address ending in a number or GUID | The user's OneDrive address has a suffix; check on your own tenant whether the old account is still in the admin center's deleted users list |
| User moved to another OU after first sign-in (directory sync) | Access denied on sites the user already used | The OU move date matches the first failure |
| Mismatch on a SharePoint site or on a OneDrive that is not the user's | Access denied to one site; other sites work | The diagnostic reports a mismatch in the UserInfo list |
| Permissions were never granted, or a link went to a different account | "You need permission", "This link is not available to you" | Check Permissions on the site shows no access; compare the signed-in account with the invited one |
| Role activation not finished (Privileged Identity Management) | The diagnostic says "No issues found" although a fault exists | The SharePoint Administrator role was activated within the last 24 hours |
The last two rows are different faults. The fourth (permissions never granted, or a different account) is covered on Microsoft's Access Denied page, and the fifth (role activation still in progress) is a caution on the mismatch page itself, so confirm the cause before you act on the mismatch.
Prove the cause before changing anything
- Write down the affected account (for example
usera@contoso.com.au), the date the old account was deleted and the date the new one was created. - Find the original OneDrive address. Microsoft's page says to sign in to the OneDrive site with an administrator account, select Settings (the gear), then OneDrive Settings, then More Settings, and copy the OneDrive Web URL from the Diagnostic Information section. For many users, the OneDrive URLs page gives a PowerShell route after
Connect-SPOService:
Connect-SPOService -Url https://contoso-admin.sharepoint.com
Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/'" | Select -ExpandProperty Url
- Check what the site already knows about the user. The command itself only reads, but Microsoft's cmdlet page says you must be a SharePoint Online administrator and a site collection administrator of the queried site. If you are not yet a site collection administrator of that site, skip this step: making yourself one with
Set-SPOUser ... -IsSiteCollectionAdmin $Trueis a change to the site's access, not part of this read-only check.
Get-SPOUser -Site https://contoso-my.sharepoint.com/personal/usera_contoso_com_au -LoginName usera@contoso.com.au
- For a non-OneDrive site, use Check Permissions: select Settings, then Site permissions, then Check Permissions in the ribbon, type the user's name and select Check Now. Also check the related security group, if any.
- Confirm the diagnostic is available for your cloud. Microsoft says it "isn't available for the GCC High or DoD environments, or for Microsoft 365 operated by 21Vianet".
- If the SharePoint Administrator role was activated through Privileged Identity Management (PIM) or PIM for Groups within the last 24 hours, wait. Microsoft warns the diagnostic "might report “No issues found”" while the permission assignment is still in progress.
Example (illustrative): on Tuesday 3 November at 09:00 an administrator at contoso.com.au deletes usera@contoso.com.au and recreates it at 09:30. On Wednesday the user gets "Access denied" on the finance site and finds an empty OneDrive at https://contoso-my.sharepoint.com/personal/usera_contoso_com_au1. The original site, .../personal/usera_contoso_com_au, still holds the files. If the diagnostic reconnects the user, Microsoft says the OneDrive changes might take approximately 24 hours, so the user should find the original files in place by Thursday morning.
Fix
Run the diagnostic
Use a SharePoint administrator account, and do the OneDrive checks first. For OneDrive sites, the page says admins "must make sure that the UserName of the new user account matches the old account", because "Administrators are prohibited from connecting OneDrive sites that might have been owned previously by another user account."
- In the Microsoft 365 admin center, select Run Tests: Site User ID Mismatch (the button on Microsoft's page loads the diagnostic).
- When prompted, enter the affected user account, such as
usera@contoso.com.au, and the original site URL from the earlier step. - Read what the diagnostic offers before you accept anything. It can offer one of three actions, described next.
Reconnect the user to the original OneDrive
When a user was sent to a new OneDrive with a suffix, the diagnostic checks whether the user can own the original site, then "will offer to reconnect the user to their original site and recycle the new active site".
Disruptive step: accepting recycles the new suffix site. Impact: anything the user saved in it since the account was recreated moves to the recycle bin with the site. Before you accept, open the suffix site as an administrator and copy any new content to the original site or to a safe folder, and write down both addresses. Back-out: Microsoft's mismatch page says "you can restore the deleted OneDrive" if the content is needed later, and its restore page (dated 2025-02-07) gives the route for a SharePoint administrator in the SharePoint Online Management Shell. First find the site: Get-SPODeletedSite -IncludeOnlyPersonalSite | FT url; if the suffix site appears, it can be restored with Restore-SPODeletedSite -Identity followed by its address. To reach the content, the page then assigns an administrator with Set-SPOUser -Site (the site address) -LoginName (the administrator's UPN) -IsSiteCollectionAdmin $True. That page also says a deleted OneDrive can be restored only for a limited period, so do not leave the recycled site unchecked for long.
Fix Access denied to the user's own OneDrive
The diagnostic reconfigures the user's profile and reconnects them to the old OneDrive. Do not try to do this by hand. Microsoft's note: "Administrators can't fix this issue by manually updating the owners of the OneDrive site or editing the user profile properties that are associated with the OneDrive site."
Disruptive step: the diagnostic changes the user's profile link to the OneDrive site. Impact: the OneDrive tile and sync target move to the old site; Microsoft says this can take approximately 24 hours. Back-out: record the user's current OneDrive address before the change; Microsoft gives no reverse step, so if the result is wrong, the record of the earlier address is the only way back, and the next step is to contact Microsoft Support.
Remove the old ID on other sites
When the diagnostic finds a mismatch in the UserInfo list on a SharePoint site or a OneDrive that does not belong to the user, it "will offer to remove the old ID". After you accept, Microsoft says to assign the new user account the appropriate permissions to the site.
Disruptive step: removing the old ID removes whatever access was tied to it. Impact: the user has no access to that site until you grant it again. Before you accept, record the user's permissions: use Check Permissions as above, and for a group-based site note which group the old entry belonged to. Back-out: re-grant the recorded permissions to the new account; the removal itself cannot be reversed.
Microsoft also writes: "If you want to fix this issue manually, you must remove the old user account from the UserInfo list, and then grant permissions to the new user account." Another Microsoft page on removing users says that process "should be used to troubleshoot Profile Property synchronization or mismatched ID issues only as advised by Microsoft Customer Support Services", so use the diagnostic.
Confirm the fix
- The user signs in and opens the finance site and their own OneDrive without an Access denied page.
- The OneDrive address no longer carries a suffix, or, if a suffix site was recycled, it no longer appears as the user's active OneDrive.
Get-SPOUser -Site(which needs a SharePoint Online administrator who is also a site collection administrator) for the site lists the new account and not the old entry, where the diagnostic removed it.- Files the user expects are present in OneDrive. Allow the 24 hours Microsoft names.
What to watch afterwards
- Other sites the user used before the account was recreated. Run the diagnostic once for each site that still fails; the page applies to SharePoint sites as well as OneDrive.
- Whether the user still holds links to the suffix site. Saved links to the recycled site stop working.
- Any plan to delete and recreate accounts. If the aim is to change a name, change the UPN on the existing account instead, and read Microsoft's UPN-change page first because that also changes the OneDrive address.
- Directory synchronisation changes. Moving users between OUs after they have signed in to SharePoint is one of the two documented triggers.
Read next
Related articles you may want next.
- TroubleshootingOneDrive for Business can't sync after a tenant migration, UPN change or password updateOneDrive for Business stuck after a tenant migration, UPN change or password update? Sign out, clear OneAuth and IdentityCache, sign in. Safe steps.Read article
- TroubleshootingYour organization's policies do not allow you to share with these users: SharePoint and OneDriveSharePoint or OneDrive says your organization's policies do not allow you to share with these users? Check the three sharing levels and change only one.Read article
- TroubleshootingEntra Connect Sync Errors: Duplicate Attributes, Soft and Hard Match ConflictsClassify Entra Connect export errors (AttributeValueMustBeUnique, InvalidSoftMatch, InvalidHardMatch, LargeObject), fix the source object on-premises and verify on the next cycle.Read article
Risks and limits
These commands have not been run or lab-tested.
- The diagnostic is run from a page button on Microsoft's site and its prompts can change. The prompts named here come from the page dated 2026-08-18.
- The diagnostic is not available for GCC High, DoD or Microsoft 365 operated by 21Vianet. In those clouds the page offers no alternative.
- Microsoft's Access Denied page describes a second route for a user who cannot reach their own OneDrive: check whether a new UPN exists, delete it and restore the original. That deletes the live new account, which can affect its licence and mailbox. It is not recommended here when the diagnostic is available; the same page says to use the diagnostic if you are not comfortable with the manual procedure.
Get-SPOUserneeds the caller to be at least a SharePoint Online administrator and a site collection administrator of the site.- The restore commands for a recycled suffix site come from Microsoft's restore page dated 2025-02-07. How long a deleted OneDrive can be restored depends on the retention settings in your tenant, so check the retention period in your tenant before relying on the back-out. A restore period applies to a deleted user's OneDrive, so confirm in your own tenant that the recycled suffix site is listed by
Get-SPODeletedSitebefore you accept the diagnostic's recycle. - If the PIM role was activated less than 24 hours ago, wait before concluding that no fault exists.
Sources
- Fix site user ID mismatch in SharePoint or OneDrive — Microsoft Learn, page dated 2026-08-18, accessed 20 November 2026
- Access Denied or You need permission errors in SharePoint Online and OneDrive — Microsoft Learn, page dated 2025-12-02, accessed 20 November 2026
- View the list of OneDrive URLs for users in your organization — Microsoft Learn, page dated 2025-04-05, accessed 20 November 2026
- How UPN changes affect OneDrive — Microsoft Learn, page dated 2025-04-04, accessed 20 November 2026
- Remove users from SharePoint — Microsoft Learn, page dated 2025-05-29, accessed 20 November 2026
- Restore a deleted OneDrive — Microsoft Learn, page dated 2025-02-07, accessed 20 November 2026
- Get-SPODeletedSite — Microsoft Learn, date not shown, accessed 20 November 2026
- Restore-SPODeletedSite — Microsoft Learn, date not shown, accessed 20 November 2026
- Get-SPOUser — Microsoft Learn, date not shown, accessed 20 November 2026
- Connect-SPOService — Microsoft Learn, date not shown, accessed 20 November 2026
This article was originally published on .