- Full Access & Send As: Use
Get-EXOMailboxPermissionandGet-EXORecipientPermission(REST v3). - Send on Behalf: Read
GrantSendOnBehalfTofromGet-EXOMailbox -PropertySets Delivery. - Calendar & Room Delegates: Use
Get-EXOMailboxFolderPermission -Identity "user:\Calendar"andGet-CalendarProcessing | Select ResourceDelegates.
Auditing who has delegate access across Exchange Online mailboxes is a critical security and compliance task. In Microsoft 365, "delegate access" is not a single settingβit spans four distinct permission layers depending on whether you are auditing executive user calendars, shared mailboxes, or meeting room/equipment resources.
Legacy scripts that only looped through Get-Mailbox and Get-CalendarProcessing missed user calendar delegates and timed out on large tenants. In this updated guide, we use the modern ExchangeOnlineManagement REST v3 module (Get-EXOMailbox, Get-EXOMailboxPermission, Get-EXORecipientPermission, Get-EXOMailboxFolderPermission, and Get-CalendarProcessing) with unattended certificate-based authentication.
The 4 Delegate Permission Layers in Exchange Online
Prerequisites
Install or update the ExchangeOnlineManagement module (v3.5+) in PowerShell 7:
Install-Module ExchangeOnlineManagement -Scope CurrentUser -Force
For unattended scheduled audits, connect using Certificate-Based App-Only Authentication (Connect-ExchangeOnline -AppId ... -CertificateThumbprint ...). See our Exchange Online Certificate Authentication Guide for setup details.
PowerShell Script: Complete Mailbox & Delegate Audit Report
The script below collects Full Access, Send As, Send on Behalf, Calendar Delegates (SharingPermissionFlags), and Resource Booking Delegates into a single normalized CSV report:
#Requires -Modules ExchangeOnlineManagement
<#
.SYNOPSIS
Exports a comprehensive Exchange Online Mailbox, Calendar, and Resource Delegate Report.
#>
param(
[string]$OutputCsv = ".\EXO-Delegates-Report-$(Get-Date -Format 'yyyyMMdd-HHmm').csv"
)
# Connect interactively (or pass -AppId, -CertificateThumbprint, -Organization for unattended runs)
Connect-ExchangeOnline -ShowBanner:$false
Write-Host "[*] Fetching mailboxes via REST v3..." -ForegroundColor Cyan
$Mailboxes = Get-EXOMailbox -ResultSize Unlimited -PropertySets Minimum, Delivery
$Report = [System.Collections.Generic.List[PSCustomObject]]::new()
$Index = 0
$Total = $Mailboxes.Count
foreach ($Mbx in $Mailboxes) {
$Index++
Write-Progress -Activity "Auditing Mailbox Delegates" -Status "$Index of $Total : $($Mbx.UserPrincipalName)" -PercentComplete (($Index / $Total) * 100)
# 1. Full Access Permissions (exclude system/inherited defaults)
$FullAccess = Get-EXOMailboxPermission -Identity $Mbx.UserPrincipalName |
Where-Object { -not $_.IsInherited -and $_.User -notmatch 'NT AUTHORITY\\SELF|S-1-5-' }
foreach ($Perm in $FullAccess) {
$Report.Add([PSCustomObject]@{
Mailbox = $Mbx.PrimarySmtpAddress
MailboxType = $Mbx.RecipientTypeDetails
PermissionLayer = "FullAccess"
Delegate = $Perm.User
AccessRights = ($Perm.AccessRights -join ", ")
SharingFlags = ""
})
}
# 2. Send As Permissions
$SendAs = Get-EXORecipientPermission -Identity $Mbx.UserPrincipalName |
Where-Object { $_.Trustee -ne "NT AUTHORITY\SELF" }
foreach ($Perm in $SendAs) {
$Report.Add([PSCustomObject]@{
Mailbox = $Mbx.PrimarySmtpAddress
MailboxType = $Mbx.RecipientTypeDetails
PermissionLayer = "SendAs"
Delegate = $Perm.Trustee
AccessRights = ($Perm.AccessRights -join ", ")
SharingFlags = ""
})
}
# 3. Send on Behalf
foreach ($Delegate in $Mbx.GrantSendOnBehalfTo) {
$Report.Add([PSCustomObject]@{
Mailbox = $Mbx.PrimarySmtpAddress
MailboxType = $Mbx.RecipientTypeDetails
PermissionLayer = "SendOnBehalf"
Delegate = $Delegate
AccessRights = "SendOnBehalf"
SharingFlags = ""
})
}
# 4. Outlook Calendar Folder Delegates (User & Shared Mailboxes)
$CalPerms = Get-EXOMailboxFolderPermission -Identity "$($Mbx.UserPrincipalName):\Calendar" -ErrorAction SilentlyContinue |
Where-Object { $_.User.DisplayName -notin @("Default", "Anonymous") }
foreach ($Cal in $CalPerms) {
$Report.Add([PSCustomObject]@{
Mailbox = $Mbx.PrimarySmtpAddress
MailboxType = $Mbx.RecipientTypeDetails
PermissionLayer = "CalendarFolder"
Delegate = $Cal.User.DisplayName
AccessRights = ($Cal.AccessRights -join ", ")
SharingFlags = ($Cal.SharingPermissionFlags -join ", ")
})
}
# 5. Resource Booking Delegates (Room & Equipment Mailboxes)
if ($Mbx.RecipientTypeDetails -in @("RoomMailbox", "EquipmentMailbox")) {
$CalProc = Get-CalendarProcessing -Identity $Mbx.UserPrincipalName
foreach ($ResDel in $CalProc.ResourceDelegates) {
$Report.Add([PSCustomObject]@{
Mailbox = $Mbx.PrimarySmtpAddress
MailboxType = $Mbx.RecipientTypeDetails
PermissionLayer = "ResourceDelegate"
Delegate = $ResDel
AccessRights = "Approve/Decline Bookings"
SharingFlags = "ResourceDelegates"
})
}
}
}
$Report | Export-Csv -Path $OutputCsv -NoTypeInformation -Encoding UTF8
Write-Host "[+] Delegate audit complete. Exported $($Report.Count) entries to $OutputCsv" -ForegroundColor Green
Disconnect-ExchangeOnline -Confirm:$false
Quick One-Liner: Resource Room Delegates Only
If you only need to audit Room and Equipment booking approvers, filter by -RecipientTypeDetails RoomMailbox,EquipmentMailbox before calling Get-CalendarProcessing to keep execution under a few seconds:
Get-EXOMailbox -RecipientTypeDetails RoomMailbox,EquipmentMailbox -ResultSize Unlimited |
ForEach-Object {
$Cal = Get-CalendarProcessing -Identity $_.UserPrincipalName
[PSCustomObject]@{
RoomName = $_.DisplayName
PrimarySmtp = $_.PrimarySmtpAddress
BookingProcessing = $Cal.AutomateProcessing
ResourceDelegates = ($Cal.ResourceDelegates -join "; ")
}
} | Export-Csv ".\Room-Delegates.csv" -NoTypeInformation -Encoding UTF8
π¬ Reader Comments & Feedback
Did this runbook help, or did Microsoft change a cmdlet or UI menu? Share your feedback below.
Leave a Comment or Report an Update