Add-MailboxPermission FullAccess Delegation Persistence Detection in M365
Attackers holding Exchange Admin or compromised mailbox rights gain stealth persistence by running Add-MailboxPermission -AccessRights FullAccess or Add-RecipientPermission -AccessRights SendAs for a secondary sleeper account. Because delegation lives on the mailbox ACL, resetting the target executive’s password does NOT revoke the attacker’s ongoing mailbox access.
Detection Objective & Threat Scope
One of the sneakiest post-compromise persistence traps in Exchange Online occurs when an attacker breaks into an Exchange Admin or executive account, quietly adds another compromised test or contractor account as a FullAccess delegate on the CEO’s mailbox, and steps back.
Days later, the SOC detects the initial phishing click on the CEO’s account, resets the CEO’s password, revokes the CEO’s sessions, and declares containment complete—completely unaware that the attacker continues opening every CEO email directly from the forgotten delegate mailbox.
In Purview UAL (RecordType 1), administrative delegation writes Add-MailboxPermission (FullAccess/ReadPermission) and Add-RecipientPermission (SendAs/SendOnBehalf), while user-configured Outlook Delegate Access records Add-MailboxFolderPermission or Set-Mailbox -GrantSendOnBehalfTo. Attackers frequently pass `-AutoMapping $false` so the executive mailbox does not automatically appear in the delegate’s desktop Outlook sidebar.
Even after delegation is planted, MailItemsAccessed logs expose it when MailboxOwnerUPN differs from the accessing UserId (with LogonType=2 Delegate).
Forensic Telemetry Fields & High-Signal Indicators
| Telemetry Field / Pattern | Meaning in M365 / Entra | High-Signal Threat Indicator |
|---|---|---|
Add-MailboxPermission | Grants mailbox read/write ACL rights | Watch Parameters.AccessRights = FullAccess |
Add-RecipientPermission | Grants SendAs impersonation rights | Watch Parameters.AccessRights = SendAs |
Add-MailboxFolderPermission | Folder-level delegate (Inbox/Calendar) | Can expose private executive calendars/folders |
Parameters.AutoMapping = False | Prevents Outlook from auto-mounting mailbox | Common stealth evasion flag in PowerShell |
LogonType = 2 (Delegate) | Mailbox opened by a delegated account | MailboxOwnerUPN != UserId in MailItemsAccessed |
Parameters.User / Trustee | Account granted persistent access | Investigate trustee account for compromise |
Sweep All Non-Inherited FullAccess, SendAs & Folder Delegations
Connect-ExchangeOnline
# 1. All FullAccess delegations across tenant:
Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission |
Where-Object { ($_.IsInherited -eq $false) -and ($_.User -notmatch "NT AUTHORITY\\SELF") } |
Select-Object Identity, User, AccessRights
# 2. Check UAL for historical Add-MailboxPermission grants:
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-90) -EndDate (Get-Date) -Operations Add-MailboxPermission,Add-RecipientPermission -ResultSize 5000
Sample Unauthorized Delegation Discovery
Identity User AccessRights
-------- ---- ------------
ceo@contoso-demo.invalid svc-legacy-sync@contoso.invalid {FullAccess}
Password Reset vs. Mailbox Delegation Survival
| Persistence Mechanism | Stopped by Victim Password Reset? | Required Removal Command |
|---|---|---|
| Victim Session Cookie | Only with Revoke-MgUserSignInSession | Revoke-MgUserSignInSession -UserId victim |
| FullAccess Delegation | NO — Delegate logs in with own credentials | Remove-MailboxPermission -Identity victim -User delegate -AccessRights FullAccess |
| SendAs Delegation | NO — Delegate sends from own account | Remove-RecipientPermission -Identity victim -Trustee delegate -AccessRights SendAs |
| Inbox Rule | NO — Executes automatically on Exchange | Remove-InboxRule -Mailbox victim -Identity <RuleId> |
Add-MailboxPermission FullAccess Event in AuditData
{
"CreationTime": "2026-12-01T09:30:11Z",
"Operation": "Add-MailboxPermission",
"RecordType": 1,
"Workload": "Exchange",
"UserId": "compromised.admin@contoso-demo.invalid",
"ClientIP": "185.220.101.45",
"Parameters": [
{ "Name": "Identity", "Value": "ceo@contoso-demo.invalid" },
{ "Name": "User", "Value": "svc-legacy-sync@contoso-demo.invalid" },
{ "Name": "AccessRights", "Value": "FullAccess" },
{ "Name": "AutoMapping", "Value": "False" }
]
}
Notice AutoMapping: False alongside FullAccess for svc-legacy-sync—a deliberate anti-detection parameter used to prevent desktop Outlook prompts while maintaining silent REST/OWA access.
Real-World Incident Walkthrough
Following a helpdesk account compromise, the intruder executes `Add-MailboxPermission -Identity ceo@company.com -User svc-legacy-sync@company.com -AccessRights FullAccess -AutoMapping $false`.
Three weeks later, the SOC audits `RecordType 1` exports inside AuditVane, catches `Add-MailboxPermission`, discovers `svc-legacy-sync` was reading the CEO’s mailbox cleanly via LogonType 2 Delegate sessions, and revokes both the ACL entry and the rogue service account.
Step-by-Step Triage, Containment & Verification
- Search Purview UAL exports inside AuditVane for Add-MailboxPermission, Add-RecipientPermission, and Add-MailboxFolderPermission.
- Run the full-tenant Get-MailboxPermission sweep on every executive, finance, legal, and shared AP mailbox.
- Flag any unexpected service accounts, dormant test users, or contractor identities listed as FullAccess or SendAs trustees.
- Remove rogue delegations immediately using Remove-MailboxPermission and Remove-RecipientPermission.
- Investigate the trustee account’s Entra Sign-In logs and reset/disable it immediately.
- Inspect MailItemsAccessed logs where MailboxOwnerUPN differs from UserId to scope exposure.
How to Verify Containment Completed Cleanly
- Get-MailboxPermission shows only approved executive assistants and authorized apps.
- Rogue trustee account disabled and sessions revoked.
- All SendAs and Inbox folder permissions verified clean.
Analyst Blind Spots, Licensing Quirks & False Positives
Security teams frequently forget Add-MailboxFolderPermission (such as granting Reviewer/Editor directly on `executive@domain.com:\Inbox`). Check folder-level permissions as well as top-level mailbox FullAccess.
Shared mailboxes legitimately grant FullAccess to security groups—focus on newly added individual users or anomalous service accounts.
Frequently Asked Questions
Does resetting the executive’s password remove FullAccess delegation?
No! The delegate signs in using their own account credentials and reads the executive’s mailbox via the ACL grant.
How does delegate access look in MailItemsAccessed?
MailboxOwnerUPN displays the executive’s address while UserId and ClientIPAddress show the delegated attacker account.
Should I check SendAs permissions separately from FullAccess?
Yes, FullAccess lets a delegate read mail while SendAs lets them impersonate the sender—audit both Get-MailboxPermission and Get-RecipientPermission.
What does AutoMapping False do?
It suppresses automatic mounting of the delegated mailbox inside the delegate’s desktop Outlook profile, helping attackers stay hidden.