Saturday, October 24, 2020
Home Microsoft 365 PowerShell How to delete legacy users from SharePoint Online sites using PowerShell

How to delete legacy users from SharePoint Online sites using PowerShell

The preceding steps removed access to Microsoft 365 and SharePoint Online. However, the user or guest still appears in people searches and in the SharePoint Online Management Shell when you use the Get-SPOUser cmdlet. To completely remove people from SharePoint, you must remove them from the UserInfo list.

Using the SharePoint Online Management Shell

Download the latest SharePoint Online Management Shell.

Connect to SharePoint Online as a global admin or SharePoint admin in Microsoft 365. To learn how, see Getting started with SharePoint Online Management Shell.

Run the following command:

Remove-SPOUser -Site https://test.sharepoint.com -LoginName jondoe_test.com#EXT#@test.onmicrosoft.com

You can also try to Delete Orphan Users

Most Popular

Microsoft 365 All Tenants in the admin center

More than one-third of admins that use the Microsoft 365 admin center manage multiple tenants. This applies to two-thirds of enterprise customers...

Windows Defender Advanced Threat Protection (ATP) software is undergoing some changes

Microsoft has announced that its Windows Defender Advanced Threat Protection (ATP) software is undergoing some changes. The antivirus program is expanding beyond...

Improvements to SharePoint news feeds and digests

The news feed delivers an intelligent view of news, targeted to you based on factors like your role or location, and further...

Microsoft Endpoint Management Deploy an application to a device

From the Microsoft Endpoint Management admin center, you can initiate an application install in real time for a tenant attached device.