Direct Inward Dialing: +1 408 916 9393
Removing an Exchange mailbox is a routine offboarding and cleanup task, but what remove does depends on the environment and the exact cmdlet. The difference matters because some of these actions also delete the user account. This guide covers removing a mailbox in both Exchange Online and on-premises Exchange Server using three methods: PowerShell, the Exchange admin center, and ManageEngine ADManager Plus.
Install-Module -Name ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName admin@contoso.onmicrosoft.com
A removed mailbox and its contents are only recoverable within the deleted-mailbox retention period (30 days by default in Exchange Online), and removing an on-premises mailbox also removes the AD account. If you only want to free up the mailbox but keep the user, disable it rather than remove it. Check for a litigation or legal hold first, since a mailbox on hold is retained and may not delete as expected.
Use Remove-Mailbox to delete an Exchange Online mailbox. For a user mailbox, this also deletes the associated Microsoft 365 user account. The user and mailbox are normally recoverable for 30 days.
Remove-Mailbox -Identity "sales@zylker.com"
If you need to retain the user account, remove its Exchange Online license instead. Review any retention or hold requirements before proceeding.
Confirm the mailbox is gone by trying to retrieve it; a not found result means it was removed. In Exchange Online, you can also list soft-deleted mailboxes that are still within the retention window:
# Confirm the mailbox no longer exists
Get-Mailbox -Identity "James Bond" -ErrorAction SilentlyContinue
# List soft-deleted mailboxes (Exchange Online)
Get-Mailbox -SoftDeletedMailbox | Select-Object Name, PrimarySmtpAddress, WhenSoftDeleted
A soft-deleted mailbox is purged automatically at the end of the retention period, but you can remove it immediately with Remove-Mailbox -PermanentlyDelete, referencing it by its distinguished name or ExchangeGUID:
Remove-Mailbox -Identity "James Bond" -PermanentlyDelete -Confirm:$false
A permanently deleted mailbox is gone, with no recovery after the retention period is bypassed. Be certain before using -PermanentlyDelete, and confirm no hold applies.
On-premises, Remove-Mailbox deletes the mailbox and the AD user account. Run it in the Exchange Management Shell:
Remove-Mailbox -Identity "James Bond"
To delete the mailbox but keep the AD account, use Disable-Mailbox instead, which disconnects the mailbox:
Disable-Mailbox -Identity "James Bond"
Preview either command first with -WhatIf, which reports what would happen without making the change, and use -Confirm:$false to skip the prompt in a script:
Remove-Mailbox -Identity "James Bond" -WhatIf
A remote mailbox is an on-premises AD user with Exchange attributes linked to a mailbox hosted in Exchange Online. Use the on-premises Exchange Management Shell to manage its removal. The cmdlet you choose determines whether the AD user account is retained.
Use Remove-RemoteMailbox to delete the on-premises user account and its associated Exchange Online mailbox:
Remove-RemoteMailbox -Identity "jbond"
The cloud mailbox removal depends on directory synchronization and is not immediate.
To remove the mailbox but keep the AD user account, remove the user’s Exchange Online license first. Then run Disable-RemoteMailbox to remove the Exchange attributes from the on-premises account and request removal of the cloud mailbox through directory synchronization:
Disable-RemoteMailbox -Identity "jbond"
The AD user account remains available for other services. If the mailbox has an online archive, disable the archive first and allow directory synchronization to complete before disabling the remote mailbox:
Disable-RemoteMailbox -Identity "jbond" -Archive=
This sequence helps prevent archive GUID mismatch errors.
If Exchange Online Delicensing Resiliency is enabled, additional steps are required to complete delicensing before running Disable-RemoteMailbox. Follow Microsoft’s delicensing guidance. Review applicable holds and retention requirements before proceeding.
| Parameter/cmdlet | Description |
|---|---|
| Remove-Mailbox | Deletes a mailbox (and the AD account on-premises); soft-deletes in Exchange Online. |
| Disable-Mailbox | Deletes the mailbox but keeps the user account, creating a disconnected mailbox. |
| -Identity | The mailbox to act on, by name, alias, email address, or distinguished name. |
| -PermanentlyDelete | Purges a soft-deleted mailbox immediately in Exchange Online. |
| -WhatIf | Previews the action without applying it. |
| -Confirm:$false | Suppresses the confirmation prompt for unattended scripts. |
| Get-Mailbox -SoftDeletedMailbox | Lists soft-deleted mailboxes still within the retention window. |
The Exchange admin center is the graphical route, and the path differs slightly by environment.
A user mailbox in Exchange Online is removed by deleting its Microsoft 365 user account, so it's handled from the Microsoft 365 admin center:
For a shared mailbox, delete it from the Exchange admin center under Recipients > Mailboxes instead, since it has no licensed user.
On-premises, the Exchange admin center removes the mailbox directly:
ManageEngine ADManager Plus is a unified AD, Exchange, and Microsoft 365 management and reporting tool that removes mailboxes one at a time or in bulk from a point-and-click console.
ADManager Plus replaces scripts and one-off portal work with a single console for AD, Microsoft 365, and Exchange management and reporting:
A common offboarding need is to free up or remove the mailbox while keeping the user account, for example, when the account is still needed for sign-in to other systems. On-premises, that's exactly what Disable-Mailbox does.
Disable-Mailbox -Identity "James Bond" -Confirm:$false
When a group leaves, you need to remove their mailboxes together. Loop a CSV of identities through the cmdlet, with error handling so one bad row doesn't stop the run.
Import-Csv "C:\Imports\leavers.csv" | ForEach-Object {
try {
Remove-Mailbox -Identity $_.Identity -Confirm:$false -ErrorAction Stop
Write-Host "Removed: $($_.Identity)"
} catch {
Write-Warning "Failed: $($_.Identity) - $($_.Exception.Message)"
}
}
A user no longer needs email but still needs their Microsoft 365 apps. Deleting the user would remove everything, so instead you remove the Exchange Online license, which tombstones the mailbox for 30 days (reassigning the same license within that window restores it with all mail). A cleaner long-term option is to convert the mailbox to a shared mailbox, which keeps it in full without a license and doesn’t affect the user’s other services.
# Convert to a shared mailbox (keeps the mailbox, frees the license)
Set-Mailbox -Identity "jbond@zylker.com" -Type Shared
Modify the user’s licenses to remove the Exchange Online plan, or convert the mailbox type:
Removing deletes the mailbox and, in on-premises Exchange, the AD user account it belongs to. In Exchange Online, removing a mailbox is tied to deleting the Microsoft 365 user or removing its license.
Disabling deletes the mailbox but keeps the user account, disconnecting the two. The mailbox becomes a disconnected (on-premises) or soft-deleted (Exchange Online) mailbox that can be reconnected or recovered within the retention period.
Yes, in Exchange Online a removed mailbox is soft-deleted and retained (30 days by default). List them by running:
Get-Mailbox -SoftDeletedMailbox | Select-Object Name, PrimarySmtpAddress, WhenSoftDeleted
You can recover one within the window, or purge it early with Remove-Mailbox -PermanentlyDelete.
For a script-free approach, generate the Soft Deleted Mailboxes report in ADManager Plus.
If others still need the mailbox, convert it to a shared mailbox and configure the required access and licensing. Keep the associated user account, as deleting it also deletes the shared mailbox.
Granting another user Full Access allows them to open an existing mailbox but does not preserve it after deletion. Configure access after conversion and before removing any licenses that are no longer required.