A Microsoft 365 mailbox investigation answers three questions in order: which sessions belonged to the attacker, what mail those sessions read, and what the attacker left behind in the mailbox to keep access or hide their tracks. This guide works through the artefacts that answer those questions: the MailItemsAccessed mailbox audit action, the context fields that separate attacker sessions from the real user, Microsoft Entra sign-in records, and inbox rules. It is written for analysts who already know how the unified audit log is collected and now need to turn its records into scoping decisions that a legal, privacy or executive audience can rely on.
The guide sits beneath two broader pages. The SaaS Forensics guide covers evidence across many SaaS platforms, and the Microsoft 365 Unified Audit Log Guide for Detection covers collection, SIEM ingestion and detections. Here the focus is narrower and deeper: one compromised account, one mailbox, and the reasoning that turns raw audit records into a defensible statement of what was exposed.
This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.
Key takeaways
- MailItemsAccessed is the core artefact for mailbox exposure. Microsoft documents that it covers POP, IMAP, MAPI, EWS, Exchange ActiveSync and REST, and that it is enabled by default for users with Office 365 E3/E5 or Microsoft 365 E3/E5 licences.
- Records come in two kinds. A Sync record is written per folder and means every item in that folder must be treated as exposed. A Bind record lists the InternetMessageId of individual messages.
- Session context (ClientIPAddress, ClientInfoString, SessionId and UserId) is how you tell attacker activity from the real user on the same account. Build that separation before you count exposed messages.
- Retention decides what you can prove. Microsoft's default policy keeps Exchange, SharePoint, OneDrive and Entra records for one year only for users with E5-type licensing; other users' records are kept for 180 days.
- Inbox rules are both persistence and concealment. The UpdateInboxRules mailbox action records when a rule is added, removed or changed, and Get-InboxRule shows what is in place now.
- Check for audit bypass before you trust an absence of records. Set-MailboxAuditBypassAssociation can stop all mailbox actions for a user from being logged.
Scoping the investigation before you query
Mailbox forensics goes wrong most often at the start, when analysts run broad searches before agreeing what they are trying to prove. Microsoft's own investigation sequence for MailItemsAccessed starts with two inputs: the mailboxes believed to be compromised and the time frame during which the attacker had access. Everything else depends on those two inputs being written down and revisited as evidence arrives.
Write a short scoping statement before running any search. It should include:
- The user principal names in scope, including shared mailboxes the compromised account could open as a delegate.
- The earliest known malicious event (for example a suspicious sign-in or a phishing click) and a deliberately wide start date before it.
- The containment time, after which attacker access should have stopped. Records after this point test whether containment worked.
- The licence assigned to each user during the window, because licensing affects both default auditing and retention.
- The decision the findings will feed: notification, legal hold, credential reset scope or simple closure.
Microsoft also notes that forensic use of these records is best done after the breach is resolved and the attacker has been evicted. In practice that means two tracks: a fast containment track run from the Microsoft 365 Tenant Compromise Playbook, and a slower evidence track that this guide describes. Do not let the second delay the first.
Preserving evidence and checking retention
Before analysis, establish how far back the evidence goes and secure it. Microsoft states that the default retention period for audit records varies by licence type and by when the records were generated. Its default audit retention policy retains records whose Workload property is AzureActiveDirectory, Exchange, OneDrive or SharePoint for one year, but only for activity by users assigned an Office 365 or Microsoft 365 E5 licence, a Microsoft Purview Suite licence or an E5 eDiscovery and Audit add-on. Records for other activities are retained for 180 days by default, and Microsoft states that non-E5 and guest users' records are retained for 180 days.
Two dated details matter for older incidents. Microsoft records that Audit (Standard) retention changed from 90 days to 180 days, with logs generated before 17 October 2023 kept for 90 days and logs generated on or after that date kept for 180 days. Ten-year retention is not a default: Microsoft states it needs a custom policy plus a 10-year audit log retention add-on licence in addition to E5 for the user who generated the record.
Practical preservation steps:
- Export the raw records for every in-scope user and the full window as soon as the incident is declared. Keep the AuditData JSON intact rather than only flattened columns.
- Record the export query, the time it ran, the account that ran it and a hash of each output file, so the export can be repeated and challenged.
- Note that Microsoft describes Entra sign-in log entries as system generated and not changeable or deletable, which supports their use as evidence, but they still age out, so export them too.
- Store exports outside the tenant under investigation, in a location the compromised identities cannot reach.
The Forensic Readiness Guide covers how to set retention and logging before an incident so that these steps are possible at all.
How MailItemsAccessed records mailbox access
Microsoft describes MailItemsAccessed as a mailbox auditing action for investigating compromised accounts by auditing access to mail data by mail protocols and clients. It is part of Exchange mailbox auditing. The mailbox auditing documentation lists it among the default audited actions for all three logon types: Owner, Delegate and Admin.
Sync records
Microsoft states that Sync operations are only recorded when a mailbox is accessed by a desktop version of Outlook for Windows or Mac. Rather than writing a record per item, the system writes an audit event for the folder containing the synced items, and Microsoft's guidance is that all mail items in a synced folder are assumed to be compromised. A single Sync record in attacker context can therefore expand exposure to an entire folder, and a sync of every folder implies the whole mailbox.
Bind records
A Bind is an individual access to an email message, and the InternetMessageId of each message is recorded. Microsoft documents that bind operations within a two-minute interval are aggregated into a single audit record, listed in the Folders field inside AuditData, with the number of aggregated operations shown in the OperationCount field. Microsoft also states that duplicate records for the same bind operations within an hour of each other are filtered out, and that sync operations are filtered at one-hour intervals.
These two rules change how you should count. A record count is not a message count, and a repeat read of the same message within the hour may not appear twice. Always expand the Folders structure and count distinct InternetMessageId values per session, rather than counting rows.
Fields to extract
| Field | Microsoft's description | Use in the investigation |
|---|---|---|
MailAccessType | Whether the access is a bind or a sync operation | Decides whether exposure is per message or per folder |
ClientIPAddress | IP address of the client machine | Joins mailbox access to sign-in records and network evidence |
ClientInfoString | Describes protocol and client, including version | Spots clients the user never uses |
SessionId | Helps differentiate bad actor actions from day-to-day activity on the same account | Groups attacker activity into sessions |
InternetMessageId | Identifies each message accessed in a bind | Builds the list of exposed messages |
OperationCount | Number of aggregated bind operations | Sanity check on expanded counts |
Logon_type | Owner (0), Admin (1) or Delegate (2) | Shows whether access came through another account's permissions |
Separating attacker sessions from the real user
The hardest part of a mailbox investigation is that the attacker and the victim use the same account. Microsoft's guidance is to compare the context of each record (ClientIPAddress, ClientInfoString, SessionId and UserId) and decide which belongs to the attacker. If a sync happened in the attacker's context, Microsoft's position is to assume the attacker synced all mail items to their client, which means the entire mailbox is compromised.
A workable method:
- Seed with known bad. Start from an indicator you trust: an IP address from a confirmed malicious sign-in, a client string the user has never used, or a session tied to a suspicious rule change.
- Expand by session. Pull every MailItemsAccessed record sharing that SessionId. Then look for other records from the same IP address and client string outside that session.
- Build a baseline of the real user. From a period before the compromise, list the IP ranges, client strings and access patterns the user normally shows. Treat anything outside it as candidate attacker activity, not proven attacker activity.
- Resolve uncertainty conservatively. Microsoft's guidance is to assume compromise where data access cannot be ruled out. Record each record you could not attribute and the reason.
- Check Logon_type. Delegate or Admin access means another identity was involved. Add that identity to scope.
Shared IP addresses complicate this. Microsoft's Entra documentation warns that there is no definitive connection between an IP address and physical location, because mobile providers and VPNs issue addresses from central pools. Use IP address as a join key, not as proof of who someone is.
Using Entra sign-in records to anchor sessions
Mailbox records tell you what was read. Sign-in records tell you how the attacker got in and which tokens they held. Microsoft documents four sign-in log types: interactive user sign-ins, non-interactive user sign-ins, service principal sign-ins and managed identity sign-ins. The legacy experience only includes interactive sign-ins, so check that you are using the newer view or exporting all four.
Non-interactive sign-ins matter because Microsoft notes that there are multiple sign-in requests for each authentication, which can appear on either the interactive or non-interactive tabs. An attacker replaying a refresh token may show little or nothing on the interactive tab. Service principal and managed identity sign-ins matter when the attacker granted consent to an application or used a workload identity, which takes the investigation into non-human identity territory covered by Microsoft 365 Security Guide.
Fields Microsoft defines that help join sign-ins to the rest of the evidence:
- Correlation ID groups sign-ins from the same sign-in session. Microsoft notes the value is based on parameters passed by the client, so it cannot guarantee its accuracy. Treat it as a helpful grouping, not tamper-proof evidence.
- Request ID corresponds to an issued token. To find sign-ins tied to a specific token, Microsoft says you first extract the request ID from the token.
- Unique token identifier identifies the token passed during the sign-in and is used to correlate the sign-in with the token request.
- Authentication requirement commonly reflects the authentication stage reached, with edge cases Microsoft documents, such as a requirement already fulfilled by a previous MFA claim.
- Conditional Access status shows Not applied, Success or Failure. Microsoft notes that Success means a policy was evaluated, not that every condition applied.
- Cross tenant access type shows whether the sign-in crossed tenant boundaries, with values including b2bCollaboration, serviceProvider and passthrough.
Join sign-ins to mailbox records on user, IP address and time first. Do not assume the mailbox SessionId and any sign-in identifier are the same value unless your own data shows they match; the Microsoft pages used for this guide do not state that relationship.
Inbox rules: persistence, forwarding and concealment
Attackers create inbox rules to forward mail out of the organisation, to move replies from the victim's contacts out of sight, or, in an older attack pattern Microsoft documents, to launch an application from a remote WebDAV server when a trigger message arrives. ATT&CK tracks the first two as T1114.003 Email Forwarding Rule and T1564.008 Email Hiding Rules.
Historic evidence: UpdateInboxRules
Microsoft's mailbox auditing documentation lists UpdateInboxRules as a default audited action for Owner, Delegate and Admin, described as an inbox rule being added, removed or changed. Pull these records for the whole window. A rule created and deleted during the attack will not appear in a current rule listing but should appear here, provided auditing was on and not bypassed. Tie each UpdateInboxRules record to the session analysis above: a rule change from the attacker's IP address and client is strong evidence.
Current state: Get-InboxRule
Microsoft documents Get-InboxRule -Mailbox <address> for a summary of rules and the same cmdlet with -Identity and Format-List for full detail. Capture the detailed output for every rule before any remediation, because Microsoft's remediation step is to delete the rule, which destroys the current-state evidence. Disable-InboxRule is also documented, and is a safer first move while you capture detail.
For the start-application pattern, Microsoft lists indicators including a rule action that starts an application, a rule that references an EXE, ZIP or URL, and new processes starting from the Outlook process on the endpoint. Its tenant-wide rules export script flags rules with an ActionType of ID_ACTION_CUSTOM and an IsPotentiallyMalicious value of TRUE; Microsoft notes the script is archived and needs edits before use, so treat it as a reference rather than a supported tool. Microsoft also documents the EnableUnsafeClientMailRules registry value on clients: 1 means the protective patch was overridden.
What to record about each rule
- Name, conditions and actions, including any forwarding or redirect address and target folder.
- Whether it was created in the attacker's session, from UpdateInboxRules context.
- The date range during which it was active, which bounds how much mail was diverted.
- Whether the rule matches messages from specific senders or keywords, which often reveals the attacker's objective.
Checking for gaps and audit tampering
An absence of MailItemsAccessed or UpdateInboxRules records proves nothing until you check that auditing was working for that mailbox. Two documented checks:
- DefaultAuditSet. Microsoft documents
Get-Mailbox -Identity <mailbox> | Format-List DefaultAuditSet. A value of Admin, Delegate, Owner means Microsoft-managed default actions are audited for all three logon types. A blank value means all three have been customised, so check which actions are actually configured. - Audit bypass. Microsoft states that Set-MailboxAuditBypassAssociation prevents all mailbox actions by the specified users from being logged. Check with
Get-MailboxAuditBypassAssociation -Identity <mailbox> | Format-List AuditByPassEnabled; True means auditing is bypassed. Search the admin audit trail for when bypass was set and by whom.
Also check licensing changes during the window. MailItemsAccessed is enabled by default for the E3/E5 licences Microsoft names; a licence removed during the window may change what was recorded, and retention follows the licence of the user who generated the record. Record every gap you find in the report rather than smoothing over it.
Turning records into findings
The output of a mailbox investigation is usually a list of exposed messages and a narrative of attacker actions. Build both from the same evidence.
- Exposure list. For each attacker session, list folders exposed by Sync and messages exposed by Bind. Resolve InternetMessageId values to messages through a content search or eDiscovery so that reviewers can check content for personal or regulated data, as Microsoft's guidance recommends.
- Timeline. Merge sign-ins, MailItemsAccessed, UpdateInboxRules and containment actions into one timeline in UTC. The Forensic Timeline Analysis Guide covers normalisation and super-timeline technique.
- Confidence levels. Mark each finding as confirmed (attacker session, direct record), probable (shared context, no direct record) or assumed (uncertainty resolved conservatively).
- Header and message evidence. Where the attacker sent mail from the account, the Email Forensics and Header Analysis Guide covers header analysis.
Microsoft's example searches use Search-UnifiedAuditLog in Exchange Online PowerShell with -Operations MailItemsAccessed and a filter on the MailAccessType value. An illustrative pattern, adapted from that documentation, is shown below; adjust dates, users and result size to your scope and paginate for large mailboxes.
Search-UnifiedAuditLog -StartDate <start> -EndDate <end> -UserIds <user> -Operations MailItemsAccessed -ResultSize 1000 | Where {$_.AuditData -like '*"MailAccessType","Value":"Bind"*'}
Common failure patterns
- Counting rows as messages. Two-minute aggregation and one-hour de-duplication mean row counts understate or misstate exposure. Expand Folders and count distinct InternetMessageId values.
- Ignoring Sync. Teams list bound messages and forget that one Sync in attacker context exposes a whole folder.
- Deleting rules before capturing them. Remediation removes the current-state evidence. Capture Get-InboxRule detail first.
- Trusting absence. No records may mean bypass, customised audit sets or expired retention, not no access.
- Treating IP address as identity. VPN and mobile pools mean the real user and the attacker can share address space.
- Interactive sign-ins only. Token replay often shows on the non-interactive tab, and app-based access on the service principal tab.
- Exporting too late. Records for non-E5 users age out after 180 days by default, and an incident discovered months later may already be partly unprovable.
Practitioner checklist
- Write a scoping statement: users, window, containment time, licences and the decision the findings feed.
- Export MailItemsAccessed, UpdateInboxRules and all four sign-in log types for the window, hash the files and store them outside the tenant.
- Confirm DefaultAuditSet and audit bypass status for every in-scope mailbox and record the result.
- Build a pre-compromise baseline of the user's IP ranges and client strings.
- Group attacker activity by SessionId, ClientIPAddress and ClientInfoString, and record the attribution confidence for each session.
- Treat every folder synced in attacker context as fully exposed, and list distinct InternetMessageId values for binds.
- Capture detailed Get-InboxRule output before disabling or removing any rule.
- Add delegates, admins and any applications seen in service principal sign-ins to scope.
- Document every gap in evidence and how it was resolved.
Standards and references
- Microsoft Learn: Use MailItemsAccessed to investigate compromised accounts
- Microsoft Learn: Manage mailbox auditing
- Microsoft Learn: Manage audit log retention policies
- Microsoft Learn: Sign-in logs in Microsoft Entra ID
- Microsoft Learn: Sign-in log activity details
- Microsoft Learn: Detect and remediate Outlook rules and custom forms injections
- MITRE ATT&CK: Remote Email Collection
- NIST: SP 800-86 Guide to Integrating Forensic Techniques into Incident Response
Related NHI Mgmt Group resources: SaaS Forensics · Microsoft 365 Unified Audit Log Guide for Detection · Microsoft 365 Tenant Compromise Playbook · Email Forensics and Header Analysis Guide