Remove and forget external users in Office365

April 7th, 2014 | Posted by Marijn in community | Office365 | PowerShell | social

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 https://contoso-admin.sharepoint.com -credential admin@contoso.com
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)

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

Leave a Reply

%d bloggers like this: