Skip to content

How to Delete a user in Microsoft 365

Before you delete a user in Microsoft 365, you can choose to save most of the data, such as email aliases and mailbox permissions. This way, you can recover most of the user settings data if you decide to restore the mailbox within 30 days from the Microsoft 365 recycle bin. In this article, you will learn how to delete a user in Microsoft 365 admin center and with PowerShell.

Delete Microsoft 365 user account

When you delete the user, you can save some of the user mailbox settings or delete them. Once you soft-delete a user, it will remain in the Microsoft 365 recycle bin for 30 days. Within these 30 days, you can choose to restore or hard-delete the user. After these 30 days, it will permanently delete the user account.

Note: When you delete a user account in Microsoft 365, it will delete the user, including their mailbox, Microsoft Teams, and all other services with it. If you only want to delete the mailbox and keep the user account, you have to disable the user mailbox and not delete the user account.

In Microsoft 365 admin center, you have the option to delete a user and:

  • Delete the user data settings (email aliases/mailbox permission)
  • Keep the user data settings (email aliases/mailbox permission)

When you delete the user in Microsoft Entra ID or with PowerShell, it will automatically keep these user data settings (email aliases and mailbox permissions).

Note: When you delete a user in Microsoft 365 admin center, there is an option to preserve most of the settings. You can restore deleted users and recover their data, except for calendar items and aliases, for up to 30 days from the deleted users list.

You can delete a user account in three methods:

  1. Microsoft 365 admin center
  2. Microsoft Entra ID
  3. Exchange Online PowerShell

Method 1. Delete user in Microsoft 365 admin center

To delete a user in Microsoft 365 admin center, follow these steps:

  1. Sign in to Microsoft 365 admin center
  2. Click Users > Active users
  3. Select the user
  4. Click Delete user
Delete user mailbox in Microsoft 365 admin center
  1. Clear the box Email aliases will be removed
  2. Clear the box Mailbox delegate permissions will be removed
  3. Click Delete user

Note: It’s best to save most of the user mailbox settings, such as email aliases and mailbox permissions, in case you need to restore the user. If all the options are greyed out, it means the user doesn’t have these settings set.

Delete user and restore data in Microsoft 365 admin center

It will automatically delete the user account and unassign licenses.

  1. Click Close
The user account has been deleted in Microsoft 365 admin center
  1. Click Users > Deleted users
  2. Verify the deleted user in the list
Find soft-deleted user mailbox in deleted users list in Microsoft 365 admin center

Method 2. Delete user in Microsoft Entra ID

To delete a user in Microsoft Entra ID, follow these steps:

  1. Sign in to Microsoft Entra ID
  2. Click Identity > Users > All users
  3. Select the user mailbox
  4. Click Delete
Delete user mailbox in Microsoft Entra ID
  1. Click OK to confirm

It will automatically delete the user and save most of the user data settings.

Delete the selected user in Microsoft Entra ID
  1. Click Identity > Users > Deleted users
  2. Verify the deleted user in the Microsoft Entra ID recycle bin

Method 3. Delete user with PowerShell

To delete a user in PowerShell, follow these steps:

  1. Start Windows PowerShell as administrator
  2. Install the Exchange Online PowerShell module
  3. Run the Connect-ExchangeOnline cmdlet to Connect to Exchange Online PowerShell.
Connect-ExchangeOnline
  1. Run the Remove-Mailbox PowerShell cmdlet to soft-delete the user

Note: When you delete a user with PowerShell it will save most of the user mailbox settings. Within 30 days, you can decide to Restore a deleted Micosoft 365 mailbox. There is no option to delete the user and remove data settings in PowerShell.

Remove-Mailbox -Identity "Adam.Mackay@m365info.com" -Confirm:$false
  1. To verify you soft-deleted the user, you can run the below PowerShell command
Get-Mailbox -SoftDeletedMailbox "Adam.Mackay@m365info.com"

The PowerShell output shows the soft-deleted user.

Name                      Alias           Database           ProhibitSendQuota    ExternalDirectoryObjectId
----                      -----           --------           -----------------    -------------------------
55f8d235-9a1d-49cf-83be-… Adam.Mackay     EURPR02DG108-db104 99 GB (106,300,440,… 2421e5cb-5eb0-42b8-beac-6098dd5717bf

The deleted user remains in the Microsoft Entra ID recycle bin for 30 days. Within these 30 days, you can restore the user and recover the user mailbox settings. To delete the user permanently, you need to Force delete Microsoft 365 mailbox with PowerShell.

That’s it!

Conclusion

You learned how to delete a user in Microsoft 365. There are three methods that you can choose from. When you delete a user in Microsoft 365 admin center, you can choose to delete or save most of the user mailbox settings, such as email aliases and mailbox permissions. But, if you delete a user in Microsoft Entra ID or PowerShell it will always save the user data settings.

Did you enjoy this article? You may also like Export all Microsoft 365 users MFA status report. Dont forget to follow us and share this article.

o365info Team

o365info Team

This article was written by our team of experienced IT architects, consultants, and engineers.

This Post Has 0 Comments

Leave a Reply

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