365 Exchange mailbox management

MOC: Powershell

Remove all mailbox access

Removes all mailbox access for a specific user. I’ve used this in the past to clean up primarily administrative accounts that have accrued access rights.

### Remove all mailbox access
# Get all mailboxes to which me@domain has access
$accessibleMailboxes = Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission | Where-Object { $_.User -like "me@domain.com" }
 
# Remove access for me@domain.com from each mailbox
foreach ($mailbox in $accessibleMailboxes) {
    Remove-MailboxPermission -Identity $mailbox.Identity -User "me@domain.com" -AccessRights FullAccess -Confirm:$false
}

Add mailbox access with automapping false

Automapping false allows mailbox access to be delegated without adding the mailbox to the client. This used to be really important prior to ‘New Outlook’ where additional mailboxes would quickly impact device performance (during download of the mailbox) as well as disk speed.

It’s not so much a problem today, but is still very useful where giving specific users (E.G management) the ability to enter a mailbox but without cluttering up their own client.

#Remove all access first
Remove-MailboxPermission -Identity <MailboxIdentity> -User <UserIdentity> -AccessRights FullAccess
 
#Delegate new access with automapping disabled
Remove-MailboxPermission -Identity target@domain.com -User admin@domain.com -AccessRights FullAccess -AutoMapping $false

Fleeting note - to process into a permanent note or delete within a week.