Removing a guest from SharePoint Online

You delete a guest or a former employee from Microsoft 365, but their name keeps showing up in SharePoint: in the people picker, in permissions or as created by. Worse: if you later create a new account with the same email address, that person sometimes gets Access denied. The cause is each site's hidden User Information List. This article shows how to remove a guest or user from SharePoint Online completely.

Why does a user stay in SharePoint?

The first time someone opens a SharePoint site or OneDrive, SharePoint stores their details in that site's User Information List. When you delete the user from Entra ID, that entry stays so old documents still show who created them. If a new account with the same name is created later, it has a different internal ID. SharePoint sees a mismatch and denies access.

Step 1: Delete the guest from Entra ID

  1. Go to the Microsoft Entra admin center > Users > All users.
  2. Filter on User type: Guest and find the person.
  3. Select the guest and choose Delete.

The guest goes to Deleted users for 30 days and can no longer sign in. Guests also appear in the Microsoft 365 admin center under Users > Guest users.

Step 2: Remove them from the site

  1. Open the SharePoint site as a site admin.
  2. Go to the hidden list: add /_layouts/15/people.aspx?MembershipGroupId=0 to the end of the site URL.
  3. Check the user and choose Actions > Delete Users from Site Collection.
  4. Confirm with OK.
Deleting a user from the site collection in SharePoint Online

With PowerShell, for several sites

With the SharePoint Online Management Shell you remove someone from a site in one go:

Connect-SPOService -Url https://contoso-admin.sharepoint.com
Remove-SPOUser -Site https://contoso.sharepoint.com/sites/project -LoginName "ann_customer.com#ext#@contoso.onmicrosoft.com"

A guest's LoginName contains #ext#. Find them with Get-SPOUser -Site <url> | Where-Object LoginName -like "*#ext#*". Loop over all sites with Get-SPOSite -Limit All to remove someone everywhere.

Clean up guests regularly

Still "Access denied"?

Read also

How to add external guests in Microsoft Teams
Clean up Microsoft Teams automatically with expiration policies and archiving
How to restore deleted files in Microsoft Teams and SharePoint

Nederlandstalige versie: Een gast of oud account volledig verwijderen uit SharePoint Online


More in English