To add a shared mailbox in Exchange Online, you can do this manually in Microsoft…
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.
Table of contents
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:
- Microsoft 365 admin center
- Microsoft Entra ID
- Exchange Online PowerShell
Method 1. Delete user in Microsoft 365 admin center
To delete a user in Microsoft 365 admin center, follow these steps:
- Sign in to Microsoft 365 admin center
- Click Users > Active users
- Select the user
- Click Delete user
- Clear the box Email aliases will be removed
- Clear the box Mailbox delegate permissions will be removed
- 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.
It will automatically delete the user account and unassign licenses.
- Click Close
- Click Users > Deleted users
- Verify the deleted user in the list
Method 2. Delete user in Microsoft Entra ID
To delete a user in Microsoft Entra ID, follow these steps:
- Sign in to Microsoft Entra ID
- Click Identity > Users > All users
- Select the user mailbox
- Click Delete
- Click OK to confirm
It will automatically delete the user and save most of the user data settings.
- Click Identity > Users > Deleted users
- 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:
- Start Windows PowerShell as administrator
- Install the Exchange Online PowerShell module
- Run the Connect-ExchangeOnline cmdlet to Connect to Exchange Online PowerShell.
Connect-ExchangeOnline
- 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
- 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.
This Post Has 0 Comments