Join our Newsletter — 33% off our NHI Course
Home› Guides› Microsoft 365 Unified Audit Log Guide for Detection:…
Guide SOC & Detection Engineering

Microsoft 365 Unified Audit Log Guide for Detection: Retention, Key Events and SIEM Ingestion

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 14 min read
On this page

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-AdminAuditLogConfig in Exchange Online PowerShell and confirm UnifiedAuditLogIngestionEnabled is 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-AdminAuditLogConfig changes 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- and Test- 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 DefaultAuditSet and Microsoft stops adding new default actions to it. Check with Get-Mailbox -Identity <user> | Format-List DefaultAuditSet and restore with Set-Mailbox -DefaultAuditSet Admin,Delegate,Owner.
  • Bypass: Set-MailboxAuditBypassAssociation can exclude an account from mailbox auditing. Any bypass on a human or application account is a finding; inventory them with Get-MailboxAuditBypassAssociation.
  • Org-wide switch: Get-OrganizationConfig | Format-List AuditDisabled should return False.

Retention, licensing and what you can see

CapabilityAudit (Standard)Audit (Premium)
Default retention180 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 policiesNoYes, 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 limit50,000 rows1,000,000 rows
Management Activity API bandwidthTenant baseline of 2,000 requests per minuteRoughly twice the bandwidth for E5, A5 and G5 tenants
Additional intelligent insightsCore 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

MethodBest forLimits to know
Purview portal Audit searchAd hoc investigation, scoped searchesRange up to 180 days; jobs kept 30 days; 10 concurrent jobs per user; large searches can take up to 48 hours
Search-UnifiedAuditLogScripted triage of a few users or operationsPaging through -SessionId and -SessionCommand; not suited to bulk collection
Office 365 Management Activity APIContinuous collection into a SIEM or data lakeContent 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 ingestionCheck 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.

  1. Subscribe to all five content types and include a PublisherIdentifier so you get your own throttling quota.
  2. Poll in overlapping windows and deduplicate on Id: blobs are not in chronological order and later blobs can contain earlier events.
  3. Follow NextPageUri until it disappears, and alert when a collector falls more than a few hours behind, because after 7 days the data cannot be fetched again.
  4. Keep the raw AuditData as well as parsed fields; field layouts differ per workload and change over time.
  5. 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.

BehaviourOperations (Workload)Key fieldsATT&CK
Inbox rule created or changedNew-InboxRule, Set-InboxRule (Exchange, OWA and PowerShell); UpdateInboxRules (Outlook client)Parameters: ForwardTo, RedirectTo, DeleteMessage, MoveToFolder, keywordsT1137.005 Outlook Rules, T1114.003 Email Forwarding Rule
Mailbox forwarding setSet-Mailbox (Exchange admin)ForwardingSmtpAddress, DeliverToMailboxAndForwardT1114.003
Delegate access grantedAdd-MailboxPermission, UpdateFolderPermissionsGrantee, AccessRights such as FullAccessT1098.002 Additional Email Delegate Permissions
Mail read by attackerMailItemsAccessedMailAccessType (Sync or Bind), SessionId, ClientInfoString, ClientIPAddress, OperationCountT1114.002 Remote Email Collection
Mailbox searchedSearchQueryInitiated (Exchange), SharepointSearchQueryInitiatedQuery terms such as "invoice" or "password"T1114.002, T1213.002 Sharepoint
Evidence removedHardDelete, SoftDeleteFolder, item countT1070.008 Clear Mailbox Data
Bulk file access or sharingFileDownloaded, FileAccessed, AnonymousLinkCreated, SharingSet (SharePoint)SiteUrl, UserAgent, count per hourT1530 Data from Cloud Storage, T1537 Transfer Data to Cloud Account
Application consentConsent to application (AzureActiveDirectory)IsAdminConsent, target app, permissionsT1550.001 Application Access Token
New app credentialAdd service principal credentials.Key type, target service principalT1098.001 Additional Cloud Credentials
Role assignmentAdd member to roleRole name, targetT1098.003 Additional Cloud Roles
Federation changeSet federation settings on domain, Set domain authenticationIssuer, signing certificateT1484.002 Trust Modification
eDiscovery used for collectionPurviewSearchAdded, PurviewSearchExportJobSubmitted, CaseAddedSearch scope, exporterT1114.002
Audit tamperingSet-AdminAuditLogConfig, Set-MailboxAuditBypassAssociation, Set-Mailbox with audit parametersUnifiedAuditLogIngestionEnabled, AuditBypassEnabledT1685.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-InboxRule or UpdateInboxRules that 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 MailItemsAccessed by user and SessionId. A Sync record from an unfamiliar IP or client means the whole folder should be treated as read; Bind records give the specific InternetMessageId values for notification.
  • Application persistence: alert on Consent to application records where IsAdminConsent is True, and on Add 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-MailboxPermission with 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 FileDownloaded compared with a 30-day baseline, plus any AnonymousLinkCreated on sensitive sites.
  • Logging tampering: any Set-AdminAuditLogConfig or 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

  1. 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.
  2. Scope by session: identify attacker IPs and SessionId values from sign-in records and MailItemsAccessed, then pivot across workloads on those values.
  3. 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.
  4. Determine exposure: Sync access means the folder; Bind access means listed messages; FileDownloaded and sharing records give file-level scope.
  5. 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 CreationTime to 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:unified data, and the share tested in the last quarter with a synthetic event.
  • Mean time from a malicious inbox rule to containment.
FrameworkWhere the unified audit log fits
NIST CSF 2.0PR.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. 5AU-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.1Control 8 Audit Log Management (collection, retention, central storage and review)
ISO/IEC 27001:2022 Annex A8.15 Logging, 8.16 Monitoring activities
MITRE ATT&CK v20Log 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 MailItemsAccessed was 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 UnifiedAuditLogIngestionEnabled is True in Exchange Online PowerShell and alert on any Set-AdminAuditLogConfig.
  • Verify AuditDisabled is False, every mailbox has the full DefaultAuditSet, 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 MailItemsAccessed sessions 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

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.