Commands › Exchange Online
Remove-MailboxPermission
Remove permissions from a user's mailbox or from an Exchange Server 2016, Exchange Server 2019 or Exchange Online mail user.
Quick start script
# Remove-MailboxPermission — 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-MailboxPermission
$before | Format-List
# 3. Make the change (dry run first)
Remove-MailboxPermission -Identity <MailboxIdParameter> -AccessRights <MailboxRights[]> -Instance <MailboxAcePresentationObject> -WhatIf
Remove-MailboxPermission -Identity <MailboxIdParameter> -AccessRights <MailboxRights[]> -Instance <MailboxAcePresentationObject>
# 4. Verify and diff
$after = Get-MailboxPermission
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax — 5 parameter sets
AccessRights
Remove-MailboxPermission [-Identity] <MailboxIdParameter> -AccessRights <MailboxRights[]> -User <SecurityPrincipalIdParameter>
[-BypassMasterAccountSid]
[-Confirm]
[-Deny]
[-DomainController <Fqdn>]
[-GroupMailbox]
[-IgnoreDefaultScope]
[-InheritanceType <ActiveDirectorySecurityInheritance>]
[-SoftDeletedMailbox]
[-WhatIf]
[<CommonParameters>]
Instance
Remove-MailboxPermission [[-Identity] <MailboxIdParameter>] -Instance <MailboxAcePresentationObject>
[-AccessRights <MailboxRights[]>]
[-Confirm]
[-Deny]
[-DomainController <Fqdn>]
[-GroupMailbox]
[-IgnoreDefaultScope]
[-InheritanceType <ActiveDirectorySecurityInheritance>]
[-User <SecurityPrincipalIdParameter>]
[-WhatIf]
[<CommonParameters>]
Owner
Remove-MailboxPermission [[-Identity] <MailboxIdParameter>]
[-BypassMasterAccountSid]
[-Confirm]
[-DomainController <Fqdn>]
[-GroupMailbox]
[-IgnoreDefaultScope]
[-WhatIf]
[<CommonParameters>]
ClearAutoMapping
Remove-MailboxPermission [-Identity] <MailboxIdParameter> [-ClearAutoMapping]
[-BypassMasterAccountSid]
[-Confirm]
[-DomainController <Fqdn>]
[-IgnoreDefaultScope]
[-WhatIf]
[<CommonParameters>]
1 more parameter sets — see the parameter table below.
Parameters (15)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.