Post Categories
SharePoint: Easily Remove User Profiles from a SharePoint Site
Introduction
For people managing SharePoint sites whether a site owner, or a SharePoint Administrator, there are occasions when it is desired to remove a User Profile from a particular SharePoint site. Below are main two reasons:
- Firstly, to avoid confusion; If people have left the organization, or their access was just revoked, their names will still be visible amongst the list of user profiles on the site causing confusion.
- Secondly, people who had left the organization, and then returned will usually encounter problems accessing the site. This typically occurs when their user principal name (UPN) is the same as previously, and whilst it looks the same, it is not.
Just because people were listed in this list, it does not mean they still have access to the SharePoint site. The list maintains their SharePoint profile data from the time they first accessed the SharePoint site.
It only confirms that they did have access at one point in time, and that they had accessed the site at least once.
How to remove User Profile from a SharePoint Site
Removal via the SharePoint Site in the Browser
Open the SharePoint site, and navigate to Site Permissions, and open any SharePoint access group (within the Parent site), in the address bar URL in your browser, change the number at the end from whatever is there (each group has its own number) to 0.
Example: Below is an example typical format for a SharePoint Members access group:
https://<your tenant>.sharepoint.com/sites/<your site>/_layouts/15/people.aspx?MembershipGroupId=5
Change the last number, in the case of above from 5 to 0:
https://<your tenant>.sharepoint.com/sites/<your site>/_layouts/15/people.aspx?MembershipGroupId=0
Simply select the people/person that is not needed anymore, then choose Actions > Delete Users from Site Collection:
The user profile for that user will then be completely removed from the SharePoint site.
PowerShell to Remove A User Profile
The following commands can be used to remove specific people from the SharePoint site, but you will need their email address to proceed.
Connect-SPOService -Url https://<tenant>-admin.sharepoint.com
Remove-SPOUser -Site https://<tenant>.sharepoint.com/sites/<site> -LoginName <user>@<domain>.com