Permanently Remove a Deleted Microsoft 365 User and Mailbox
Question details
Permanently remove a deleted Microsoft 365 user associated with a cloud mailbox that conflicts with an on-premises mailbox migration.

- Product
- Microsoft 365 and Exchange Online
- Device & OS
- not provided
- Scenario
- A hybrid Exchange administrator needs to resolve a mailbox migration conflict without overlooking the user's OneDrive for Business data.
- Observed behavior
- A deleted cloud mailbox remains associated with a deleted Microsoft 365 user and may conflict with the on-premises mailbox.
Confirm that the deleted user is the correct cloud object and copy any needed OneDrive for Business data before proceeding. Check retention policies and legal holds, and verify the impact on the synchronized identity and mailbox with your Exchange administrator.
Permanently delete the Microsoft 365 user with Microsoft Graph PowerShell
Use this method when the deleted user object is confirmed to be the one causing the hybrid mailbox conflict.
Permanently deleting the user is irreversible and can affect associated services and data. Retention policies or holds may affect data removal.
The older Remove-MsolUser command uses the retired Microsoft Online PowerShell module. Microsoft Graph PowerShell is the current alternative.
A deleted Exchange mailbox and a deleted Microsoft 365 user are separate objects. If the mailbox remains after the user is removed, investigate its Exchange Online status and retention requirements rather than assuming the directory deletion removed it.
Open PowerShell and run Install-Module Microsoft.Graph -Scope CurrentUser if the Microsoft Graph module is not already installed.
Run Connect-MgGraph -Scopes "User.Read.All","User.DeleteRestore.All" and sign in with an account authorized to permanently delete the user. Grant consent if prompted and permitted.
Run Get-MgDirectoryDeletedItemAsUser -All | Select-Object DisplayName,UserPrincipalName,Id,DeletedDateTime. Verify the user principal name and object ID against the affected account.
After confirming the ID and required data protection checks, run Remove-MgDirectoryDeletedItem -DirectoryObjectId "<deleted-user-object-id>" in PowerShell.
Run Get-MgDirectoryDeletedItemAsUser -All again to confirm the user is no longer listed, then check the mailbox status in the Exchange admin center before retrying the migration.

Work with Office files in WPS Office
WPS Office is a free, lightweight alternative for working with documents, spreadsheets, and presentations in a familiar interface. Open existing Office files for an easier transition; WPS Office does not remove Microsoft 365 users or resolve Exchange mailbox conflicts.

Frequently Asked Questions
Will permanently deleting the user also remove OneDrive data?
Deleting the user can affect the associated OneDrive for Business data. Copy any required files first and check your organization's retention policies and holds before deleting the user.
Can I still use Remove-MsolUser to empty the recycle bin?
Remove-MsolUser belongs to the retired Microsoft Online PowerShell module. Use Microsoft Graph PowerShell and Remove-MgDirectoryDeletedItem for a confirmed deleted user object instead.
How do I find the deleted user's object ID?
After connecting with Connect-MgGraph, run Get-MgDirectoryDeletedItemAsUser -All | Select-Object DisplayName,UserPrincipalName,Id,DeletedDateTime. Match the principal name and ID to the affected account before deleting it.
What if the cloud mailbox still appears after I remove the user?
Check the mailbox in the Exchange admin center and review its soft-deleted status, retention policies, and holds. A deleted directory user and an Exchange mailbox are separate objects, so investigate before taking further action.




