Commands › Exchange Online
Disable-RemoteMailbox
Remove user mailboxes from the cloud-based service but keep the associated user objects in the on-premises Active Directory.
Quick start script
# Disable-RemoteMailbox — 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-RemoteMailbox
$before | Format-List
# 3. Make the change (dry run first)
Disable-RemoteMailbox -Identity <RemoteMailboxIdParameter> -WhatIf
Disable-RemoteMailbox -Identity <RemoteMailboxIdParameter>
# 4. Verify and diff
$after = Get-RemoteMailbox
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax
Disable-RemoteMailbox [-Identity] <RemoteMailboxIdParameter>
[-Archive]
[-Confirm]
[-DomainController <Fqdn>]
[-IgnoreDefaultScope]
[-IgnoreLegalHold]
[-WhatIf]
[<CommonParameters>]
Parameters (7)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.