Home » Exchange Server » How to Permanently Remove Deleted Users from Office 365

How to Permanently Remove Deleted Users from Office 365

When you delete a user from the Office 365 control panel they are moved into a recycle bin for 30 days so that they can be recovered easily if the deletion was not intended.

However, if you want to permanently remove a deleted user in Office 365 you can use PowerShell. For this task you will need the Azure Active Directory for PowerShell module installed on your computer.

First, connect to your Azure Active Directory by running Connect-MsolService and entering your admin credentials in the dialog box that appears.

Caution: do not proceed unless you are completely sure that you want to permanently remove the users.

To see a list of the deleted users run Get-MsolUser with the -ReturnDeletedUsers switch.


You can remove a specific deleted user with Remove-MsolUser and the -RemoveFromRecycleBin switch.

To remove all deleted users you can pipe the Get-MsolUser output to Remove-MsolUser and add the -Force switch to avoid being prompted for each removal.

Caution: be very careful here not to accidentally delete all users from your Azure Active Directory.

Paul is a Microsoft MVP for Office Servers and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul is a co-author of Office 365 for IT Pros and several other books, and is also a Pluralsight author.
Category: Exchange Server


  1. Rob Potter says:

    Paul – great article.

    What is the impact on the user’s OneDrive, email inbox and any content that they’ve created in SharePoint? I’ve seen conflicting reports about grace periods for those, perhaps it’s changed over the last few years.

  2. sreejith says:

    I have a tenant admin account, which has got many domains created. users are created for each domain.

    I need to delete users of a particular domain.(when tenant admin has got many domains to manage) using powershell scripts. Could you please help me regarding this one.

    • Bjorn Bjornsson says:

      you could come up with something with a little of Google’s help:

      Get-MsolPartnerContract -DomainName TENANT.onmicrosoft.com

      get-msoluser -all -tenantid “TENANT-ID” -returndeletedusers | Remove-msoluser -removefromrecyclebin -force

      I post this with no responsibilty what so ever… You should try this in a test environment first!

      hope this helps you to get on the right track 🙂

      • Bjorn Bjornsson says:

        sorry you need the tenant id again in the remove command:

        get-msoluser -all -tenantid “TENANT-ID” -returndeletedusers | Remove-msoluser -tenantid “TENANT-ID” -removefromrecyclebin -force

        • Stanislav says:

          Tried this today (was logged on as a reseller, tried to purge some client’s deleted users) – did not work. It turned out that you must be logged in as an account global admin to be able to delete users.

        • Stanislav says:

          Sorry, just noticed the second part must have tenant ID as well. I tried this:

          get-msoluser -all -tenantid “TENANT-ID” -returndeletedusers | Remove-msoluser -tenantid -removefromrecyclebin -force

          and it did not work, so I probably had to run it like this:

          get-msoluser -all -tenantid “TENANT-ID” -returndeletedusers | Remove-msoluser -tenantid “TENANT-ID” -removefromrecyclebin -force

Leave a Reply

Your email address will not be published. Required fields are marked *