PowerTip: Use PowerShell to remove a user from all site collections in SharePoint Online

Doctor Scripto

Dr Scripto

Summary: Learn how to use PowerShell to remove a corporate user from all site collections in SharePoint Online.

Hey, Scripting Guy! Question How can I use Windows PowerShell to quickly remove a corporate user from all site collections in SharePoint Online?

Hey, Scripting Guy! Answer Use the following commands (change the login user name as required):

Get-SPOSite | ForEach-object{Remove-SPOUser -Site $_.Url -LoginName kmyer@contoso.com}

The Doctor

Doctor Scripto
Dr Scripto

Scripter, PowerShell, vbScript, BAT, CMD

Follow Dr Scripto   

0 comments

    Leave a comment