Microsoft
Microsoft 365 unified audit log
Mailbox, SharePoint, OneDrive, Teams and admin activity across Microsoft 365, each record carrying a JSON AuditData payload.
Why it matters
Business email compromise is investigated here: inbox rules, forwarding, what mail was read (MailItemsAccessed), what was sent, and what files were downloaded. It is the evidence behind breach notification decisions.
How long it lasts
- Audit (Standard): 180 days for records created after October 2023 (90 days in older documentation).
- Audit (Premium): 1 year by default, longer with add-on retention policies.
- MailItemsAccessed was originally an Audit (Premium) feature and was made available more broadly from 2023. Confirm it appears in your tenant before relying on it.
Get the data
Connect-ExchangeOnline
Search-UnifiedAuditLog -StartDate 2026-01-01 -EndDate 2026-01-31 -UserIds [email protected] -SessionCommand ReturnLargeSet -ResultSize 5000 |
Select-Object CreationDate, Operations, @{n='Data';e={$_.AuditData | ConvertFrom-Json}}Fields that matter
The activity: New-InboxRule, MailItemsAccessed, FileDownloaded and so on.
Which service and schema the record comes from.
The account that acted.
Source IP; the field name differs between workloads.
Groups mailbox actions from one session. Pair with sign-in logs.
Session and token identifiers (for example AADSessionId, UniqueTokenId) that tie the action to an Entra ID sign-in, where present.
Mailbox access as owner (0), admin (1) or delegate (2).
Cmdlet parameters for admin operations, including inbox rule conditions and actions.
For MailItemsAccessed: MailAccessType (Bind or Sync) and IsThrottled.
For MailItemsAccessed Bind: the folders and InternetMessageIds that were opened.
Values to know
Operation
All values- new-inboxruleNew-InboxRuleAn inbox rule was created through Exchange PowerShell or Outlook on the web.Suspicious
- set-inboxruleSet-InboxRuleAn existing inbox rule was changed.Suspicious
- updateinboxrulesUpdateInboxRulesInbox rules were changed from an Outlook desktop client.Suspicious
- set-mailboxSet-MailboxMailbox settings changed. Check for ForwardingSmtpAddress and DeliverToMailboxAndForward.Depends on context
- add-mailboxpermissionAdd-MailboxPermissionA user was granted access to another mailbox, often FullAccess.Suspicious
- add-recipientpermissionAdd-RecipientPermissionA user was granted SendAs on another recipient.Suspicious
- new-transportruleNew-TransportRuleAn organization-wide mail flow rule was created.High signal
- set-transportruleSet-TransportRuleA mail flow rule was changed.Suspicious
- mailitemsaccessedMailItemsAccessedMail was read or synchronized. The record says how (MailAccessType) and from which session.Depends on context
- sendSendA message was sent from the mailbox.Depends on context
MailAccessType
All valuesLogonType
All valuesappId
All values- 04b07795-8ddb-461a-bbee-02f9e1bf7b46Microsoft Azure CLIPublic client for the Azure command-line interface.Depends on context
- 1950a258-227b-4e31-a9cf-717495945fc2Microsoft Azure PowerShellPublic client for Azure PowerShell.Depends on context
- de8bc8b5-d9f9-48b1-a8ad-b748da725064Graph ExplorerMicrosoft Graph Explorer web tool.Depends on context
- c44b4083-3bb0-49c1-b47d-974e53cbdf3cAzure PortalAzure portal.Depends on context
- 00000002-0000-0000-c000-000000000000Azure AD Graph (resource)The legacy Azure AD Graph API. Still used by some offensive tooling.Depends on context
- 14d82eec-204b-4c2f-b7e8-296a70dab67eMicrosoft Graph Command Line ToolsPublic client used by the Microsoft Graph PowerShell SDK.Depends on context
- 29d9ed98-a469-4536-ade2-f981bc1d605eMicrosoft Authentication BrokerFirst-party broker client used for device registration and brokered sign-ins.Depends on context
- 1b730954-1685-4b74-9bfd-dac224a7b894Azure Active Directory PowerShellPublic client of the legacy AzureAD and MSOnline PowerShell modules.Depends on context
- 9ba1a5c7-f17a-4de9-a1f1-6178c8d51223Microsoft Intune Company PortalCompany Portal client used for device enrollment.Depends on context
- 797f4846-ba00-4fd7-ba43-dac1f8f63013Windows Azure Service Management APIResource ID for Azure Resource Manager (the Azure management plane).Depends on context
Traps
- Search-UnifiedAuditLog returns at most 5,000 records per call and a session can page through a capped total; split large searches by day or use the Audit search in the portal.
- Inbox rules made in desktop Outlook appear as UpdateInboxRules, not New-InboxRule.
- MailItemsAccessed pauses for 24 hours after more than 1,000 records in 24 hours for a mailbox (IsThrottled). Treat that window as fully exposed.
- Sync access names folders, not messages. Assume the whole folder was taken.
- Records can arrive hours after the activity. Re-run searches before closing scope.