Report · 1 tool
Mailbox permissions report: Full Access, Send As, Send on Behalf
Summary
Exports every delegated permission on user and shared mailboxes in one file. Run it before a mailbox migration (Send on Behalf never moves on its own) and for access reviews.
Implementation
Choose your tool. Your choice is remembered on other samples.
Connect-ExchangeOnline -ShowBanner:$false
$mailboxes = Get-EXOMailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox, SharedMailbox -Properties GrantSendOnBehalfTo
$rows = foreach ($m in $mailboxes) {
Get-EXOMailboxPermission -Identity $m.UserPrincipalName |
Where-Object { -not $_.IsInherited -and $_.User -notlike "NT AUTHORITY*" } |
ForEach-Object { [pscustomobject]@{ Mailbox = $m.PrimarySmtpAddress; Delegate = $_.User; Permission = "FullAccess" } }
Get-EXORecipientPermission -Identity $m.UserPrincipalName |
Where-Object { $_.Trustee -ne "NT AUTHORITY\SELF" } |
ForEach-Object { [pscustomobject]@{ Mailbox = $m.PrimarySmtpAddress; Delegate = $_.Trustee; Permission = "SendAs" } }
foreach ($d in $m.GrantSendOnBehalfTo) {
[pscustomobject]@{ Mailbox = $m.PrimarySmtpAddress; Delegate = $d; Permission = "SendOnBehalf" } }
}
$rows | Export-Csv .\mailbox-permissions.csv -NoTypeInformationPrerequisites
- Exchange Administrator or View-Only Organization Management
- ExchangeOnlineManagement module 3.x
Output
CSV with Mailbox, Delegate and Permission type.
Related answers
Contributors
| Author | Role |
|---|---|
| Priyanshu Upadhyay | Solution Architect, Microsoft 365 and Azure |
InnovaticT