Remove and forget external users in Office365

When we added some private external users for testing to out tenant, we were very satisfied with the results of sharing information. But now we wanted to remove them so they wouldn’t appear anymore when we made a new task or issue.

After we deleted them from the security groups, they still appeared in the people pickers. Even after we deleted the user profiles, they still showed up!

Screenshot (19)

When I posted the question on the Office365 community, August Sun came up with the answer:

Given the situation you encounter, we should use PowerShell to solve the issue. Please try the steps below:
1. Set up the SharePoint Online Management Shell Windows PowerShell environment. 
2. Connect to SharePoint Online by the following cmdlet.
Connect-SPOService -Url -credential
3. Run the cmdlet below to get the user information.
Get-SPOUser –Site https://[URL of the site with this issue]
Check whether the external users are listed.
4. If so, run the following cmdlet to remove the users one by one.
Remove-SPOUser –Site https://[URL of the site with issue] –LoginName [user’s login name]

Now, the external users were removed!

Screenshot (20)

About: Marijn

Marijn Somers (MVP) has over 14 years experience in the SharePoint world, starting out with SP2007. Over the years the focus has grown to Office 365, with a focus on collaboration and document management. He is a business consultant at Balestra and Principal Content Provider for "Mijn 365 Coach" that offers dutch employee video training. His main work tracks are around user adoption, training and coaching and governance. He is also not afraid to dig deeper in the technicalities with PowerShell, adaptive cards or custom formatting in lists and libraries. You can listen to him on the biweekly "Office 365 Distilled" podcast.

%d bloggers like this: