EE User "stefor
" provided this script, which grants Managers full mailbox access to their Direct Reports, and then also removes the auto-mapping of the mailboxes from opening in Outlook (we use an add-on in Outlook that allows manager to open a mailbox instead of using Account settings) when the Manager's open Outlook.
$users = get-user -resultsize unlimited
foreach ($user in $users)
$manUserDN = $user.DistinguishedName
$directReports = @($user.DirectReports)
if ($directReports -ne $Null)
foreach ($directReport in $directReports)
$drUserdn = $directReport.DistinguishedName
Add-MailboxPermission $drUserDN -User $manUserDN -AccessRights:FullAccess
$Mailbox = Get-Mailbox $drUserDN
$DomainController = $Mailbox.OriginatingServer
Can this script be modified so that, for each Direct Report who has the same Manager, the Direct Reports people can also be granted access to each-other's mailbox with full access, but not granted full access to their Managers? And also turn off auto-mapping (msExchDelegateListLink.Re
move) to other Direct Reports for each Direct Report?
If Direct Reports have different managers, they shouldn't be able to open eachother's Mailbox...
So basically if John is a Manager, and his direct reports are Jim and Pam, then John will have full access to Jim and Pam's, while Jim and Pam will also have access to eachother's, but not to John's.