When access to a mailbox in Exchange 2013-2019 is assigned, by default the mailbox is auto-mapped to the trustee's profile. That means if Alice gets access to Peter's mailbox, Alice will see her colleague's mailbox appearing automatically in her Outlook window.
Now let's say Alice doesn't want Peter's mailbox to be present in her Outlook all the time, she wants to add it manually from time-to-time. It is possible to disable automapping, but this property cannot be changed after the permissions are assigned. We need to remove her access rights and add it back with automapping set to false.
List Automapped mailboxes
Now, if it is not possible to amend AutoMapping attibutes, is it at least possible to query which user has which mailboxes automapped?
Fortunately, yes. The user account has an extended property, called msExchDelegateListLink, that contains all the users who has his/her mailbox automapped to their profiles.
Here is a quick one-liner to list this data. Note, that msExchDelegateListLink contains an array if there are multiple people having access to the particular user, also the users are presented with their distinguished name.
Get-ADUser -Filter * -Properties msExchDelegateListLink | ?{$_.msExchDelegateListLink -ne ""} | select Name, msExchDelegateListLink
Name msExchDelegateListLink ---- ---------------------- Alice {CN=Peter Carrey,CN=Users,DC=AlwaysHotCafe,DC=com} John Cash {CN=Alice,CN=Users,DC=AlwaysHotCafe,DC=com} Kevin Smith {CN=Alice,CN=Users,DC=AlwaysHotCafe,DC=com} Kim Taylor {CN=Peter Carrey,CN=Users,DC=AlwaysHotCafe,DC=com, CN=Alice,CN=Users,DC=AlwaysHotCafe,DC=com}
Get a Formatted List
To get a more usable output, this more sophisticated script retrieves the delegate list expanded, showing their UserPrincipalName instead of distinguished name, in a CSV format.
Get-ADUser -Filter * -Properties msExchDelegateListLink | ?{$_.msExchDelegateListLink -ne ""} | %{ $mailbox = $_.UserPrincipalName $_.msExchDelegateListLink | %{ $user = (Get-ADUser $_).UserPrincipalName [pscustomobject]@{Mailbox=$mailbox; Trustee=$user} | export-csv AutoMappedMailboxes.csv -Append -NoTypeInformation } }
AutoMappedMailboxes.csv
Verify in Outlook
In this output - for instance - we see that Alice has the following mailboxes auto-mapped in her Outlook: John Cash, Kevin Smith and Kim Taylor.
Let's check if that's truly the case
Comments