Email Recovery

Permanently Remove a Deleted Microsoft 365 User and Mailbox

Amos GikundaAmos Gikunda Nov 22, 2026 868 views

Question details

Permanently remove a deleted Microsoft 365 user associated with a cloud mailbox that conflicts with an on-premises mailbox migration.

Permanently Remove a Deleted Microsoft 365 User and Mailbox
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.
Before you start

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.

Solution 1Recommended

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.

1
Install Microsoft Graph PowerShell

Open PowerShell and run Install-Module Microsoft.Graph -Scope CurrentUser if the Microsoft Graph module is not already installed.

2
Connect with appropriate permissions

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.

3
Identify the deleted user

Run Get-MgDirectoryDeletedItemAsUser -All | Select-Object DisplayName,UserPrincipalName,Id,DeletedDateTime. Verify the user principal name and object ID against the affected account.

4
Permanently remove the object

After confirming the ID and required data protection checks, run Remove-MgDirectoryDeletedItem -DirectoryObjectId "<deleted-user-object-id>" in PowerShell.

5
Check the migration conflict

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.

Permanently delete the Microsoft 365 user with Microsoft Graph PowerShell
Check retention and mailbox status: Do not bypass a legal hold or retention requirement. If the Exchange mailbox still appears or the deletion is blocked, investigate the mailbox and applicable policies in Exchange Online and Microsoft Purview.
Free Microsoft Office alternative

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.

Open and edit Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTX.Use familiar document, spreadsheet, and presentation tools.Work with Office files in a free, lightweight suite.Review copied OneDrive Office documents independently of the mailbox migration.
microsoft office alternative - wps office

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.