How to Solve issue while accessing files shared via Microsoft Teams / OneDrive

Ganesh A Pawar 0 Reputation points
2026-04-17T04:41:30.6533333+00:00

We are facing an issue while accessing files shared via Microsoft Teams / OneDrive.

 This issue is preventing the user from accessing files shared via Teams, OneDrive / SharePoint backend

 Actions Taken:

  • Tried accessing via browser and Teams
  • Attempted re-login and different browser
  • Shared seprate excel file
  • Shared via One Drive
  • Issue persists

 Error Showing when accessing files shared via Teams (OneDrive - "There is a legacy user account in this site with same email."

We request your assistance to

Identify and remove any duplicate/legacy user account mapping in SharePoint/OneDrive

Restore proper access for the affected user

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

2 answers

Sort by: Most helpful
  1. Kai-Ex 1,560 Reputation points Microsoft External Staff Moderator
    2026-04-17T06:15:10.2233333+00:00

    Dear @Ganesh A Pawar,

    I understand that you’re unable to access files shared via Microsoft Teams / OneDrive, and the issue occurs in both the Teams client and a web browser. When opening shared files, you see the error: “There is a legacy user account in this site with same email.”

    To better assistance, could you please confirm following information:

    Was the affected user previously deleted and re-created (rehire scenario) or had a UPN/email rename recently?

    Is your environment cloud-only or hybrid (directory sync/Entra Connect)?

    Does the issue occur across multiple Teams/sites, or is it limited to one Team/one SharePoint site/one OneDrive location?

    Are users opening the shared content while signed in with the same work account that received the share (not a secondary account)?

    Are you in a specialized cloud (e.g., GCC High/DoD/21Vianet)?

    In the meantime, I recommend running Microsoft’s “Site User ID Mismatch” diagnostic

    Microsoft provides a supported diagnostic specifically to address cases where a user was deleted/recreated (or identity changed) and SharePoint/OneDrive still holds the old internal ID in the site’s UserInfo cache, resulting in access issues.

    • If the issue is tied to a OneDrive site, changes may take up to 24 hours to fully propagate after the diagnostic completes.
    • Note: This diagnostic is not available in certain sovereign clouds (e.g., GCC High/DoD/21Vianet).

    For more detail: Fix site user ID mismatch in SharePoint or OneDrive

    Note: As moderators, my primary goal is to provide helpful guidance and support through general troubleshooting steps. While I don’t have access to internal systems or administrative tools required to resolve account-specific or backend issues, I truly appreciate your understanding of these limitations. I genuinely hope the information I share helps guide you in the right direction, and I'm always here to assist as much as I can within my scope.

    Please understand that initial response does not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution.        

    Your detailed response will help diagnose and investigate the issue more efficiently. If I misunderstood what you’re looking for, feel free to let me know or share a screenshot. I’d be happy to help further!

    Thank you for your cooperation. I'm looking forward for your reply.


    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. 

    Was this answer helpful?

    1 person found this answer helpful.

  2. AI answer

    2026-04-17T04:41:47.1066667+00:00

    The error indicates a user identity mismatch in SharePoint/OneDrive (a legacy/duplicate user entry with the same email/UPN). This is a known cause of access issues and must be fixed at the SharePoint/OneDrive identity level.

    Use the following steps to restore access:

    1. Verify the affected user’s UPN
      • In Microsoft Entra ID (Azure AD), confirm the user’s current UPN and email address.
      • Check whether the user’s UPN was changed recently (for example, due to domain change or rename).
    2. Fix a site user ID/legacy account mismatch (OneDrive/SharePoint)
      • This issue usually occurs when there is a site user ID mismatch or a legacy user entry for the same email.
      • Use the documented automated fix: follow the guidance in Fix site user ID mismatch in SharePoint or OneDrive (linked from the “A user can't access their own OneDrive site” section). This tool is designed specifically to correct mismatched identities that cause access errors.
    3. If a new/duplicate UPN exists
      • If a new UPN was created for the same person and is causing the conflict:
        • Delete the new UPN in Entra ID as described in delete the new UPN.
        • Restore the original UPN as described in restore the original UPN.
      • After restoring, wait for directory sync to complete and then test access again.
    4. Remove and re-add the user on the affected site (for shared links or site access)
      • For a specific SharePoint site or OneDrive where the error appears:
        1. Go to the site’s Site permissions.
        2. Remove the affected user from the site (and from any direct sharing on the file/folder).
        3. Share the file/folder or site again with the same user so a fresh, correct identity mapping is created.
    5. If the user is a guest
      • If this is a guest account and errors persist:
        • Remove the guest completely from the Microsoft 365 admin center and from the site collection (as documented in the guest-account note).
        • Re-invite the guest and then re-share the content.
    6. Use the “Check User Access” diagnostic (for admins)
      • In the Microsoft 365 admin center, run the Check User Access diagnostic for SharePoint/OneDrive.
      • This will automatically check for common access and identity issues for both internal and guest users and provide guided remediation.

    After completing the above, have the user sign out of all sessions, close all browsers/Teams clients, sign back in, and then try opening the files again from Teams and directly from OneDrive/SharePoint.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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