Error when trying to access SharePoint Online or OneDrive for Business

Symptoms

When users try to access SharePoint Online or OneDrive for Business, they receive one of the following error messages:

  • Access Denied
  • You need permission to access this site
  • User not found in the directory

Cause

Many scenarios can generate these error messages. The most frequent cause is that permissions for the user or administrator are configured incorrectly or not configured at all.

Resolution

Use the appropriate method for the SharePoint or OneDrive site on which the user receives the error message.

Accessing a SharePoint site

  1. Determine which permission level (member, owner, and so on) the user should have to the site. Then, verify the permissions through the Check Permissions feature, as follows:

    1. Navigate to the User.aspx page. To do this, select the gear icon in the upper-right corner, select Site Permissions, and then select Advanced permissions settings.

      For example, the full URL will resemble the following: https://contoso.sharepoint.com/_layouts/15/user.aspx

    2. On the ribbon, select Check Permissions.

    3. In the User or Group field, type the user's name, and then select Check Now.

      Note

      This command displays the type of permissions that the user has on a site and which security group is the permissions are derived from (if applicable).

  2. If the user does not have appropriate permissions, grant the permissions to the file or site for the user.

  3. If the user continues to receive an error message, remove the user from the site by using the following steps.

    Note

    This option is available only if the user previously browsed to the site collection. Users are not listed if they are granted access but never visit the site.

    1. Browse to the site, and edit the URL by adding the following string to the end of it: /_layouts/15/people.aspx?MembershipGroupId=0

      For example, the full URL resembles the following: https://contoso.sharepoint.com/_layouts/15/people.aspx/membershipGroupId=0

    2. On the list, select the user, open the Actions menu, and then select Delete Users from Site Collection.

    3. Grant the permissions to the file or site for the user.

Accessing a OneDrive site

  • If the user is the owner of the OneDrive site

    This issue most frequently occurs if a user is deleted and re-created by having the same user principal name (UPN). The new account is created by using a different Passport Unique ID (PUID) value. When the user tries to access a site collection or their OneDrive site, the user has an incorrect PUID. A second scenario involves directory synchronization with an Active Directory organizational unit (OU). Users may experience this issue if they have already signed in to SharePoint, are moved to a different OU that is not currently synchronized with Office365, and are then resynced with SharePoint.

    1. To resolve this issue, delete the new UPN (if it exists), and restore the original UPN.

      1. To delete the new UPN, follow the steps in Add or delete users using Azure Active Directory.
      2. After the new user is deleted, restore the original user by following the steps in Restore or remove a recently deleted user using Azure Active Directory.
    2. If you cannot restore the original user, and the issue persists, create a support request, as follows:

      1. Navigate to https://admin.microsoft.com.

      2. In the navigation pane, select Support > New Service Request.

        Note

        This activates the Need Help? pane on the right side of the screen.

      3. In the Briefly describe your issue area, enter PUID Mismatch on OneDrive Site.

      4. Select Contact Support.

        Note

        If you are using the old M365 admin center, you can skip the next step because the Description field will not exist.

      5. In the Description field, enter PUID Mismatch on OneDrive Site.

      6. Complete the remaining information, and then select Contact me.

      7. After the ticket is opened, provide for the support agent the UPN and OneDrive URL that is experiencing the issue.

  • If the user is trying to access another user's OneDrive site

    1. Determine which permission level (member, owner, and so on) the user should have to the site. Then, verify the permissions through the Check Permissions feature, as follows:

      1. Navigate to the User.aspx page. For example, the full URL will resemble the following:

        https://contoso-my.sharepoint.com/personal/admin_contoso_onmicrosoft_com/_layouts/15/user.aspx.

      2. On the ribbon, select Check Permissions.

      3. In the User or Group field, type the user's name, and then select Check Now.

        Note

        This command displays the type of permissions that the user has on a site and which security group the permissions are derived from (if applicable).

    2. If the user does not have appropriate permissions, grant the permissions to the file or site for the usre.

    3. If the user continues to receive an error message, remove the user from the site by using the following steps.

      Note

      This option is available only if the user previously browsed to the site collection. Users are not listed if they are granted access but never visit the site.

      1. Browse to the site, and edit the URL by adding the following string to the end of it:

        /_layouts/15/people.aspx?MembershipGroupId=0

        For example, the full URL will resemble the following:

        https://contoso-my.sharepoint.com/personal/admin_contoso_onmicrosoft_com/_layouts/15/people.aspx/membershipGroupId=0

      2. On the list, select the user, open the Actions menu, and then select Delete Users from Site Collection.

      3. Grant the permissions to the file or site for the user.

More information

For more information about permission levels in SharePoint Online, see Understanding permission levels.

For more information about "Access Denied" errors in SharePoint or OneDrive for Business, see the following articles:

Still need help? Go to SharePoint Community.