The Microsoft 365 unified audit log is the only record of what happened inside Exchange Online, SharePoint, OneDrive, Teams and the tenant's identity layer, and it pays to confirm what it records, and for how long, before you need it. It is on by default for most enterprise tenants, but retention depends on licence, events arrive with hours of delay, the search tools cap exports, and several of the most useful mailbox events are only recorded if the mailbox's audit settings were left intact. This guide explains how the log is collected and retained, which operations matter for detection, how to pull it reliably into a SIEM, and the detections a SOC should build first. It is written for detection engineers, SOC analysts and Microsoft 365 administrators. Tenant hardening is covered separately in the Microsoft 365 Security Guide; this page is about the log.
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
- Check that ingestion is actually on. Run
Get-AdminAuditLogConfigin Exchange Online PowerShell and confirmUnifiedAuditLogIngestionEnabledis True; SMB and trial tenants are not on by default. - Retention is licence-driven. Audit (Standard) keeps 180 days; Audit (Premium) keeps Exchange, SharePoint, OneDrive and Entra records for a year by default, and longer only with policies and add-ons.
- Stream, do not search. Use the Office 365 Management Activity API (or a connector built on it) into a SIEM; content is only available for 7 days and the portal export caps at 50,000 rows on Standard.
- MailItemsAccessed is the key event for mailbox access. It separates sync from bind access and carries a SessionId that splits attacker activity from the real user.
- Watch the non-human identities. Consent grants, new service principal credentials and application permissions such as mailbox-wide access are the persistence routes that survive a password reset.
How the unified audit log is collected
The unified audit log aggregates records from workloads (Exchange, SharePoint and OneDrive, Microsoft Entra ID, Teams, Power Platform, Purview and others) into one searchable store with a common schema. Every record carries CreationTime, Id, Operation, RecordType, UserId, UserType, ClientIP, Workload, ResultStatus and OrganizationId, plus a workload-specific AuditData payload.
- Default state: on by default for Microsoft 365 enterprise organisations. Business Basic, Business Standard and Business Premium tenants, and unmanaged tenants on enterprise trials, must enable it. Enabling can take up to 60 minutes to apply and several hours before events become searchable.
- Checking it: use Exchange Online PowerShell, not Security and Compliance PowerShell, where the same property always reads False.
Get-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabled. - Turning it off is itself logged:
Set-AdminAuditLogConfigchanges appear as that operation, with admin and IP. When ingestion is off, the Purview search,Search-UnifiedAuditLog, the Management Activity API and Microsoft Sentinel all receive nothing. - Latency: Microsoft states core services (Exchange, SharePoint, OneDrive, Teams) typically appear in 60 to 90 minutes and makes no commitment for others. Detections on this log are near-real-time at best; design response times accordingly.
- Exchange admin cmdlets: only cmdlets that change configuration are recorded.
Get-,Search-andTest-cmdlets are not logged, so reconnaissance through PowerShell leaves little trace here.
Mailbox auditing is a separate layer
Exchange mailbox auditing feeds the unified log and is on by default. Microsoft manages a default set of audited actions per logon type. For owners these include MailItemsAccessed, Send, UpdateInboxRules, HardDelete and SoftDelete; delegates add SendAs and SendOnBehalf. MailboxLogin and SearchQueryInitiated exist for owners but are not on by default.
- DefaultAuditSet: if anyone customises a mailbox's audited actions for a logon type, that type drops out of
DefaultAuditSetand Microsoft stops adding new default actions to it. Check withGet-Mailbox -Identity <user> | Format-List DefaultAuditSetand restore withSet-Mailbox -DefaultAuditSet Admin,Delegate,Owner. - Bypass:
Set-MailboxAuditBypassAssociationcan exclude an account from mailbox auditing. Any bypass on a human or application account is a finding; inventory them withGet-MailboxAuditBypassAssociation. - Org-wide switch:
Get-OrganizationConfig | Format-List AuditDisabledshould return False.
Retention, licensing and what you can see
| Capability | Audit (Standard) | Audit (Premium) |
|---|---|---|
| Default retention | 180 days for all records (90 days for records before 17 October 2023) | 1 year for Exchange, SharePoint, OneDrive and Entra ID records; 180 days for others |
| Custom retention policies | No | Yes, up to 50 policies, 7 days to 1 year; 3, 5, 7 and 10 years with the 10-Year Audit Log Retention add-on |
| Portal export limit | 50,000 rows | 1,000,000 rows |
| Management Activity API bandwidth | Tenant baseline of 2,000 requests per minute | Roughly twice the bandwidth for E5, A5 and G5 tenants |
| Additional intelligent insights | Core mail access, send and search events (see the CISA playbook below) | Extra properties and events, for example sensitivity labels on accessed items |
- Per user, not per tenant: retention follows the licence of the user who generated the record. Non-E5 users and guests stay at 180 days even in an E5 tenant.
- Not retroactive: a new 10-year policy only applies to records ingested after it exists, and records generated by non-user entities (service principals, system events) are held for a fixed one year under the 10-year option.
- Who configures it: retention policies need the Organization Configuration role; search needs Audit Logs or View-Only Audit Logs. Treat both as privileged, because they reveal and shape the evidence.
- The 2023 expansion: in 2023 Microsoft expanded Standard logging. CISA's Microsoft Expanded Cloud Logs Implementation Playbook (January 2025) covers enabling mail items accessed, mail sent and Exchange and SharePoint search events under Purview Audit (Standard), and ingesting them into Sentinel and Splunk.
For a whole-estate view of what SaaS logs cost and how long each keeps them, see the SaaS Audit Log Retention and Licensing Guide.
Getting the log into a SIEM
| Method | Best for | Limits to know |
|---|---|---|
| Purview portal Audit search | Ad hoc investigation, scoped searches | Range up to 180 days; jobs kept 30 days; 10 concurrent jobs per user; large searches can take up to 48 hours |
Search-UnifiedAuditLog | Scripted triage of a few users or operations | Paging through -SessionId and -SessionCommand; not suited to bulk collection |
| Office 365 Management Activity API | Continuous collection into a SIEM or data lake | Content available for 7 days only (error AF20051); first blobs can take up to 12 hours after subscribing; 24-hour query windows |
| Vendor SIEM connectors (for example Sentinel's Microsoft 365 connector) | Turnkey ingestion | Check which content types and record types the connector actually collects |
The Management Activity API exposes five content types: Audit.AzureActiveDirectory, Audit.Exchange, Audit.SharePoint, Audit.General (Teams, Power Platform, Purview and everything else) and DLP.All. A collector needs an Entra app registration with ActivityFeed.Read, which is itself a non-human identity with read access to the whole tenant's activity; give it a certificate credential, an owner and monitoring.
- Subscribe to all five content types and include a
PublisherIdentifierso you get your own throttling quota. - Poll in overlapping windows and deduplicate on
Id: blobs are not in chronological order and later blobs can contain earlier events. - Follow
NextPageUriuntil it disappears, and alert when a collector falls more than a few hours behind, because after 7 days the data cannot be fetched again. - Keep the raw
AuditDataas well as parsed fields; field layouts differ per workload and change over time. - Test end to end: create a test inbox rule and a sharing link in a pilot mailbox and time how long each takes to reach the SIEM.
Pipeline design choices are discussed in the Security Data Pipeline Guide and, for Sentinel, the Microsoft Sentinel Guide.
Operations that matter for detection
ATT&CK v20 models detections as analytics tied to log sources, and m365:unified is one of the most referenced SaaS log sources in the enterprise matrix. The table lists operations Microsoft documents, mapped to the techniques they help detect. Some Entra operation strings end with a full stop (for example Add service principal credentials.), so copy names from a real record before building a filter; Entra activity names are shown here as the portal displays them.
| Behaviour | Operations (Workload) | Key fields | ATT&CK |
|---|---|---|---|
| Inbox rule created or changed | New-InboxRule, Set-InboxRule (Exchange, OWA and PowerShell); UpdateInboxRules (Outlook client) | Parameters: ForwardTo, RedirectTo, DeleteMessage, MoveToFolder, keywords | T1137.005 Outlook Rules, T1114.003 Email Forwarding Rule |
| Mailbox forwarding set | Set-Mailbox (Exchange admin) | ForwardingSmtpAddress, DeliverToMailboxAndForward | T1114.003 |
| Delegate access granted | Add-MailboxPermission, UpdateFolderPermissions | Grantee, AccessRights such as FullAccess | T1098.002 Additional Email Delegate Permissions |
| Mail read by attacker | MailItemsAccessed | MailAccessType (Sync or Bind), SessionId, ClientInfoString, ClientIPAddress, OperationCount | T1114.002 Remote Email Collection |
| Mailbox searched | SearchQueryInitiated (Exchange), SharepointSearchQueryInitiated | Query terms such as "invoice" or "password" | T1114.002, T1213.002 Sharepoint |
| Evidence removed | HardDelete, SoftDelete | Folder, item count | T1070.008 Clear Mailbox Data |
| Bulk file access or sharing | FileDownloaded, FileAccessed, AnonymousLinkCreated, SharingSet (SharePoint) | SiteUrl, UserAgent, count per hour | T1530 Data from Cloud Storage, T1537 Transfer Data to Cloud Account |
| Application consent | Consent to application (AzureActiveDirectory) | IsAdminConsent, target app, permissions | T1550.001 Application Access Token |
| New app credential | Add service principal credentials. | Key type, target service principal | T1098.001 Additional Cloud Credentials |
| Role assignment | Add member to role | Role name, target | T1098.003 Additional Cloud Roles |
| Federation change | Set federation settings on domain, Set domain authentication | Issuer, signing certificate | T1484.002 Trust Modification |
| eDiscovery used for collection | PurviewSearchAdded, PurviewSearchExportJobSubmitted, CaseAdded | Search scope, exporter | T1114.002 |
| Audit tampering | Set-AdminAuditLogConfig, Set-MailboxAuditBypassAssociation, Set-Mailbox with audit parameters | UnifiedAuditLogIngestionEnabled, AuditBypassEnabled | T1685.002 Disable or Modify Cloud Log |
Sign-in detail (risk, Conditional Access result, device) is richer in the Entra sign-in logs than in the unified log's UserLoggedIn and UserLoginFailed records; correlate the two rather than relying on either. See the Entra ID Sign-In and Audit Log Detection Guide.
Detections to build first
- Forwarding and hiding rules: alert on any
New-InboxRule,Set-InboxRuleorUpdateInboxRulesthat forwards or redirects externally, deletes messages, or moves them to RSS Feeds, Archive or Conversation History, especially within an hour of a sign-in from a new IP. This is the core business email compromise pattern; see the Business Email Compromise Response Playbook. - Mailbox access from a second session: group
MailItemsAccessedby user andSessionId. A Sync record from an unfamiliar IP or client means the whole folder should be treated as read; Bind records give the specificInternetMessageIdvalues for notification. - Application persistence: alert on Consent to application records where
IsAdminConsentis True, and onAdd service principal credentials.outside change windows. Legacy or newly consented apps with application-level Exchange permissions can read mail with no user signing in. See the Consent Phishing and Illicit OAuth Grants Guide. - Delegation and eDiscovery abuse:
Add-MailboxPermissionwith FullAccess on executive or finance mailboxes, and eDiscovery searches or exports created by anyone outside the legal and compliance group. - Bulk SharePoint or OneDrive collection: per-user hourly counts of
FileDownloadedcompared with a 30-day baseline, plus anyAnonymousLinkCreatedon sensitive sites. - Logging tampering: any
Set-AdminAuditLogConfigor new audit bypass association should page someone, as should a gap of more than a few hours in a content type that normally flows.
Running an investigation with the log
- Preserve first: export the affected users' records for the full available range before retention expires, and confirm whether those users hold E5 (one year) or Standard (180 days) retention.
- Scope by session: identify attacker IPs and
SessionIdvalues from sign-in records andMailItemsAccessed, then pivot across workloads on those values. - Persistence sweep: list inbox rules (
Get-InboxRule), forwarding, delegates, consented apps and new app credentials for every affected account, because the audit record may have aged out while the setting remains. - Determine exposure: Sync access means the folder; Bind access means listed messages;
FileDownloadedand sharing records give file-level scope. - Record gaps: note any period where ingestion, mailbox auditing or the collector was off. Regulators and insurers will ask.
Measuring coverage
- Percentage of mailboxes with the full
DefaultAuditSet(Admin, Delegate, Owner) and no bypass association (target 100 per cent). - Collector lag per content type: time from
CreationTimeto SIEM arrival (target under 2 hours for Exchange and Entra). - Days of searchable history for privileged and executive users (target at least 365).
- Number of detections in production that use
m365:unifieddata, and the share tested in the last quarter with a synthetic event. - Mean time from a malicious inbox rule to containment.
| Framework | Where the unified audit log fits |
|---|---|
| NIST CSF 2.0 | PR.PS-04 log records generated and available; DE.CM-03 monitoring personnel activity and technology usage; DE.AE-02 analysis of adverse events; DE.AE-03 correlation across sources |
| NIST SP 800-53 Rev. 5 | AU-2 Event Logging, AU-6 Audit Record Review, AU-9 Protection of Audit Information, AU-11 Audit Record Retention, AU-12 Audit Record Generation, SI-4 System Monitoring |
| CIS Controls v8.1 | Control 8 Audit Log Management (collection, retention, central storage and review) |
| ISO/IEC 27001:2022 Annex A | 8.15 Logging, 8.16 Monitoring activities |
| MITRE ATT&CK v20 | Log source m365:unified across analytics for T1114, T1098, T1137.005, T1530, T1550.001, T1484.002 and others |
Common failure patterns
- Assuming the log is on: SMB and trial-derived tenants often have ingestion off, and nobody notices until a search returns nothing.
- Relying on portal search during an incident: the 50,000-row export cap on Standard truncates exactly the bulk-access events an investigation needs. Collect continuously instead.
- Collector silently failing: an expired certificate on the API app or a disabled webhook stops collection, and after 7 days the missing content cannot be retrieved.
- Customised mailbox audit sets: a one-off script years ago trimmed audited actions, so
MailItemsAccessedwas never added for those mailboxes when Microsoft extended the defaults. - Licence mismatch: security assumes one-year retention because the tenant has some E5 seats, but the compromised finance users are on E3 and their records expired at 180 days.
- Ignoring application identities: detections focus on user sign-ins while consent grants and service principal credentials, common attacker routes, go unwatched.
Lessons from incidents
- Record before you need it: the event you need must be recorded, retained and alerted on before an incident; it cannot be switched on afterwards for the past.
- Watch application events, not only sign-ins: a detection stack that only watches user sign-ins misses activity by OAuth applications; consent, app credential and role events in the unified log are where it shows.
- Business email compromise generally: the persistent artefacts (forwarding rules, hidden folders, delegate grants) often outlive the audit records that created them. Sweep current mailbox configuration as well as searching history.
Practitioner checklist
- Confirm
UnifiedAuditLogIngestionEnabledis True in Exchange Online PowerShell and alert on anySet-AdminAuditLogConfig. - Verify
AuditDisabledis False, every mailbox has the fullDefaultAuditSet, and no unexpected bypass associations exist. - Collect all five Management Activity API content types continuously, with lag and gap alerting.
- Secure the collector app registration with a certificate, an owner and monitoring of its own sign-ins.
- Map retention by user licence and add audit retention policies for privileged, executive and finance users.
- Deploy detections for forwarding rules, delegate grants, admin consent, new service principal credentials and federation changes.
- Correlate
MailItemsAccessedsessions with Entra sign-in logs and use Sync versus Bind to scope exposure. - Restrict Audit Logs, View-Only Audit Logs and Organization Configuration roles and review holders quarterly.
- Test each detection quarterly with a synthetic event in a pilot mailbox and record end-to-end latency.
Standards and references
- Microsoft Learn: Learn about auditing solutions in Microsoft Purview
- Microsoft Learn: Turn auditing on or off
- Microsoft Learn: Audit log activities
- Microsoft Learn: Office 365 Management Activity API reference
- Microsoft Learn: Use MailItemsAccessed to investigate compromised accounts
- Microsoft Learn: Manage mailbox auditing
- CISA: Microsoft Expanded Cloud Logs Implementation Playbook
- MITRE ATT&CK: Remote Email Collection
Related NHI Mgmt Group resources: Microsoft 365 Security Guide · Entra ID Sign-In and Audit Log Detection Guide · Exchange Online Security Guide · Entra ID Applications and Consent Guide · Detection Engineering Guide