Commands › Exchange Online

Remove-Mailbox

Exchange Online ExchangeOnlineManagement Remove-*

Delete mailboxes and the associated user accounts.

Quick start script

# Remove-Mailbox — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-Mailbox
$before | Format-List

# 3. Make the change (dry run first)
Remove-Mailbox -Identity <MailboxIdParameter> -Database <DatabaseIdParameter> -StoreMailboxIdentity <StoreMailboxIdParameter> -WhatIf
Remove-Mailbox -Identity <MailboxIdParameter> -Database <DatabaseIdParameter> -StoreMailboxIdentity <StoreMailboxIdParameter>

# 4. Verify and diff
$after = Get-Mailbox
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax — 3 parameter sets

Identity

Remove-Mailbox [-Identity] <MailboxIdParameter>
 [-Permanent <Boolean>]
 [-Arbitration]
 [-AuditLog]
 [-AuxAuditLog]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Force]
 [-IgnoreDefaultScope]
 [-IgnoreLegalHold]
 [-Migration]
 [-PublicFolder]
 [-RemoveArbitrationMailboxWithOABsAllowed]
 [-RemoveLastArbitrationMailboxAllowed]
 [-SupervisoryReviewPolicy]
 [-WhatIf]
 [<CommonParameters>]

StoreMailboxIdentity

Remove-Mailbox -Database <DatabaseIdParameter> -StoreMailboxIdentity <StoreMailboxIdParameter>
 [-Arbitration]
 [-AuditLog]
 [-AuxAuditLog]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Force]
 [-IgnoreDefaultScope]
 [-IgnoreLegalHold]
 [-Migration]
 [-PublicFolder]
 [-RemoveArbitrationMailboxWithOABsAllowed]
 [-RemoveLastArbitrationMailboxAllowed]
 [-SupervisoryReviewPolicy]
 [-WhatIf]
 [<CommonParameters>]

Default

Remove-Mailbox [-Identity] <MailboxIdParameter> [-PermanentlyDelete]
 [-Confirm]
 [-Force]
 [-Migration]
 [-PublicFolder]
 [-RemoveCNFPublicFolderMailboxPermanently]
 [-WhatIf]
 [<CommonParameters>]

Parameters (20)

ParameterTypeRequiredWhat it controls
-Identity MailboxIdParameter yes The Identity parameter identifies the mailbox that you want to remove. You can use any value that uniquely identifies the mailbox. For example:
-Database DatabaseIdParameter yes This parameter is available only in on-premises Exchange.
-StoreMailboxIdentity StoreMailboxIdParameter yes This parameter is available only in on-premises Exchange.
-Arbitration SwitchParameter This parameter is available only in on-premises Exchange.
-AuditLog SwitchParameter This parameter is available only in on-premises Exchange.
-AuxAuditLog SwitchParameter This parameter is available only in on-premises Exchange.
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-Force SwitchParameter The Force switch hides warning or confirmation messages. You don't need to specify a value with this switch.
-IgnoreDefaultScope SwitchParameter This parameter is available only in on-premises Exchange.
-IgnoreLegalHold SwitchParameter This parameter is available only in on-premises Exchange.
-Migration SwitchParameter The Migration switch is required to remove migration mailboxes. You don't need to specify a value with this switch.
-Permanent Boolean This parameter is available only in on-premises Exchange.
-PermanentlyDelete SwitchParameter This parameter is available only in the cloud-based service.
-PublicFolder SwitchParameter The PublicFolder switch is required to remove public folder mailboxes. You don't need to specify a value with this switch.
-RemoveArbitrationMailboxWithOABsAllowed SwitchParameter This parameter is available only in on-premises Exchange.
-RemoveCNFPublicFolderMailboxPermanently SwitchParameter This parameter is available only in the cloud-based service.
-RemoveLastArbitrationMailboxAllowed SwitchParameter This parameter is available only in on-premises Exchange.
-SupervisoryReviewPolicy SwitchParameter This parameter is available only in on-premises Exchange.
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.