SharePoint Immersion Experience

A journey of a TSP for Collaboration

Bulk remove user from Office 365

Bulk remove user from Office 365

  • Comments 1
  • Likes

Prepare a CSV File to Import New Exchange Online Users:

You can refer to the steps below to bulk remove the users:
1.Create a CSV file that contains all the users you want to remove:
The CSV file should include the five required attributes: Name, EmailAddress, FirstName, LastName, Password.


2.Install and Configure Windows PowerShell
3.Connect Windows PowerShell to the Service
4.Run the command below:
$users =Import-Csv C:\Users\...\Desktop\Password.csv
$users | ForEach-Object {Remove-Mailbox –Identity $_.EmailAddress}

Note : You should find the path of the CSV file, and use the path instead of C:\Users\...\Desktop\.

  • Thank you for this code. I tried this code and it works. However, I need to give permission to delete the account one by one. I got around 3000+ user to remove, is there any way that I can auto permit the deletion?

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment