Created
September 8, 2025 15:06
-
-
Save supermarsx/be052d27e76e3ac2a18ff247f59eb443 to your computer and use it in GitHub Desktop.
Exchange remove auto mapping mailboxes for user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set the user to fix | |
| $user = "DOMAIN\UserName" | |
| # Reapply FullAccess with AutoMapping disabled on every mailbox where the user currently has FullAccess | |
| Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox,SharedMailbox,RoomMailbox,EquipmentMailbox | | |
| Where-Object { | |
| Get-MailboxPermission -Identity $_.Identity -User $user -ErrorAction SilentlyContinue | | |
| Where-Object { $_.AccessRights -contains "FullAccess" -and -not $_.IsInherited } | |
| } | ForEach-Object { | |
| Remove-MailboxPermission -Identity $_.Identity -User $user -AccessRights FullAccess -Confirm:$false | |
| Add-MailboxPermission -Identity $_.Identity -User $user -AccessRights FullAccess -AutoMapping:$false | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment