How to Search the Mailbox Audit Log in Microsoft 365

The short answer
Search-MailboxAuditLog and New-MailboxAuditLogSearch are retired from Exchange Online, so use Search-UnifiedAuditLog or the Microsoft Purview portal. In Purview, open Audit, set dates, activities and users, then run the search. For activity inside a shared mailbox, use Search-UnifiedAuditLog with -FreeText. Standard licenses keep records 180 days; E5 keeps Exchange records a year.
Search-MailboxAuditLog is retired. How to search the Microsoft 365 mailbox audit log in Purview or with Search-UnifiedAuditLog, plus retention limits.
On this page
- 01Is Search-MailboxAuditLog deprecated? What replaces it
- 02Before you start
- 03How to search the mailbox audit log in the Purview portal
- 04Which audit operations to search (FolderBind, MailItemsAccessed, SoftDelete)
- 05Audit (Standard) vs. Audit (Premium) retention
- 06What to do when the search doesn't work
- 07What about your own AI agent's actions?
To search the mailbox audit log in Microsoft 365, open the Microsoft Purview portal, choose Audit, set a date range, activities and users, and run the search. Search-MailboxAuditLog no longer exists in Exchange Online: Microsoft confirmed in February 2026 that it and New-MailboxAuditLogSearch are fully retired, replaced by Search-UnifiedAuditLog.
Mailbox audit logging has been on by default across Office 365 and Microsoft 365 since January 2019, so the records usually already exist. What trips people up is scope: the Users field and -UserIds show what a person did, not everything that happened in a mailbox. That difference decides whether a shared mailbox search comes back empty.
Quick path
Is Search-MailboxAuditLog deprecated? What replaces it#
Yes, and in Exchange Online it's gone. Microsoft's retirement notice, updated February 18, 2026, says both cmdlets "have been fully retired and removed from Exchange Online" and that all audit log searches must now use Search-UnifiedAuditLog.
The cmdlets' Microsoft Learn pages still read "will be deprecated", so go by the notice. Those pages also list the cmdlets for on-premises Exchange Server, where this retirement doesn't apply. Here is how an old script maps across:
| Old cmdlet or parameter | Replacement |
|---|---|
| Search-MailboxAuditLog | Search-UnifiedAuditLog in Exchange Online PowerShell |
| New-MailboxAuditLogSearch | A search job on the Purview Audit Search page, then Export |
| -Identity <mailbox> | -FreeText (Get-Mailbox <mailbox>).ExchangeGuid |
| -Mailboxes a,b | One -FreeText search per mailbox |
| -LogonTypes | No matching parameter. Read LogonType in each record's AuditData |
| -ShowDetails | AuditData comes back by default. Add -Formatted to make it easier to read |
| -Operations | -Operations |
| -ResultSize up to 250,000 | -ResultSize up to 5,000, or -SessionCommand ReturnLargeSet with a -SessionId for up to 50,000 by paging |
Don't filter on -RecordType ExchangeItem alone
Before you start#
Confirm that auditing is active and which sign-in type you're investigating. Microsoft audits a different set of actions by default for owners, delegates and admins.
- Confirm the org-wide setting. Run Get-OrganizationConfig | Format-List AuditDisabled in Exchange Online PowerShell. False means mailbox auditing on by default is active, and that overrides whether auditing is enabled on individual mailboxes.
- Get the right role. Searching needs the Audit Logs or View-Only Audit Logs role in the Microsoft Purview portal, which the Audit Manager and Audit Reader role groups include. Running the cmdlet needs the same role in the Exchange admin center. A mailbox owner without one of these roles has to ask an admin.
- Check the mailbox type. User, shared and Microsoft 365 Group mailboxes support auditing on by default, though Group mailboxes log a smaller fixed set. Resource and public folder mailboxes aren't supported.
| Sign-in type | Who it covers | Main actions logged by default |
|---|---|---|
| Owner | The account associated with the mailbox | Send, SoftDelete, HardDelete, MoveToDeletedItems, Update, Create, UpdateInboxRules, UpdateFolderPermissions, UpdateCalendarDelegation, MailItemsAccessed |
| Delegate | A user with SendAs, SendOnBehalf or FullAccess permission, including an admin with FullAccess | SendAs, SendOnBehalf, SoftDelete, HardDelete, MoveToDeletedItems, Update, Create, UpdateInboxRules, UpdateFolderPermissions, MailItemsAccessed. Not FolderBind |
| Admin | eDiscovery searches, MAPI Editor access, or an account impersonating another user | The delegate set plus Send and UpdateCalendarDelegation. Not FolderBind |
Opening a mailbox isn't audited by default
How to search the mailbox audit log in the Purview portal#
The portal is the fastest path for a one-off look at what a named person did. For everything that happened inside one mailbox, use the -FreeText command above.
- 1
Open Audit in the Purview portal
Sign in to the Microsoft Purview portal and select the Audit solution card. If it isn't showing, select View all solutions, then Audit under Core, and stay on the Search page.
- 2
Set the date range
Pick a start and end date and time, shown in UTC. The default is the last seven days, and one search can't span more than 180 days.
- 3
Choose the activities
In Activities - friendly names, pick entries such as Deleted messages from Deleted Items folder or Accessed mailbox items. Or type exact names in Activities - operations names, such as SoftDelete,HardDelete,MoveToDeletedItems. A misspelled operation name returns nothing.
- 4
Name the users
Add the people whose actions you want in Users. Leave it blank to include everyone, though broad searches in large tenants can take up to 48 hours, then filter the finished results.
- 5
Run it and wait for the job
Select Search. The job keeps running if you close the browser and moves through Queued, In Progress and Completed, and you can run up to 10 at once. Exchange records typically appear 60 to 90 minutes after the activity, but Microsoft doesn't commit to a fixed delay.
- 6
Read or export the results
Open the completed job to see the date, IP address, user and activity for each record, and select one for full details. Use Export for a CSV of up to 50,000 rows on Audit (Standard) or 1,000,000 on Audit (Premium). Completed jobs are kept for 30 days.
The Users field won't show activity inside a shared mailbox
Once a search job finishes, the result reads like a timeline: who, what action, and exactly when. To check who has access, run Get-MailboxPermission <mailbox>, and see Full Access vs Send As vs Send on Behalf for what each one allows. If the message never arrived at all, you want a message trace in Microsoft 365 instead.

Which audit operations to search (FolderBind, MailItemsAccessed, SoftDelete)#
These are the operation names that answer most mailbox questions. Copy them exactly, because the search matches on the precise name.
| Operation | What it logs |
|---|---|
| SoftDelete | A message deleted from Deleted Items or permanently deleted with Shift+Delete, moved to Recoverable Items |
| HardDelete | A message purged from the Recoverable Items folder |
| MoveToDeletedItems | A message moved to the Deleted Items folder |
| SendAs | A message sent as though it came from the mailbox owner |
| SendOnBehalf | A message sent on the owner's behalf, showing recipients who actually sent it |
| UpdateInboxRules | An inbox rule added, changed or removed in the Outlook desktop client. New-InboxRule and Set-InboxRule cover Outlook on the web |
| FolderBind | A folder or the mailbox opened by a delegate or admin. Off by default |
| MailItemsAccessed | Mail accessed through any protocol or client. MailAccessType Bind means one message; Sync means Outlook desktop downloaded a folder |
MailItemsAccessed licensing depends on which page you read
Audit (Standard) vs. Audit (Premium) retention#
How far back you can search depends on licensing, and it's the most common reason a real investigation comes up empty: the record existed, but it aged out first.
| Audit (Standard) | Audit (Premium) | |
|---|---|---|
| Requires | Most Microsoft 365 and Office 365 enterprise plans | An Office 365 or Microsoft 365 E5 license, Microsoft Purview Suite, or the E5 eDiscovery and Audit add-on |
| Default retention | 180 days. Records generated before October 17, 2023 were kept 90 days | 1 year for Exchange, SharePoint, OneDrive and Microsoft Entra records; 180 days for the rest |
| Custom retention | Not available | Policies from 7 days to 1 year. 3, 5, 7 and 10 years need the 10-Year Audit Log Retention add-on |
| Search export limit | Up to 50,000 rows | Up to 1,000,000 rows |
Retention follows whoever did the action
What to do when the search doesn't work#
- No results at all. Run Get-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabled in Exchange Online PowerShell. If it's False, audit log search is off for the tenant. Don't check this in Security & Compliance PowerShell, where the value always shows False.
- Nothing for a shared mailbox. You probably searched by the mailbox address in Users or -UserIds. Use -FreeText instead. If that's also empty, run Get-Mailbox <mailbox> | Select AuditEnabled,AuditOwner,AuditDelegate,AuditAdmin, because one of Microsoft's guides warns shared mailbox auditing might not be enabled by default.
- Events missing for users without E5. Microsoft says mailbox audit events can fail to appear for non-E5 users even with auditing on by default. Its workaround is Set-Mailbox -Identity <mailbox> -AuditEnabled $true, and if the value is already True, set it to $false and back to $true.
- The activity isn't in the default set. FolderBind has to be added to AuditDelegate or AuditAdmin first, and it can't reach back to events from before you added it.
- "The selected date range is greater than 180 days." One search job is capped at 180 days. If you use the full range, Microsoft says to select the current time for the start date, or you'll get a start date error.
- The record isn't there yet. Exchange records typically surface within 60 to 90 minutes, with no guaranteed delay. For a live incident, run the search again later before you conclude that nothing was logged.
What about your own AI agent's actions?#
We build AI Emaily, an AI email client, and its audit log covers only what its own agent did, so it's no substitute for Purview when a colleague or admin touched a mailbox. If that narrower question is yours, see how undo and audit work for AI email actions.
Frequently asked
See it in AI Emaily
Keep reading
Sources
- Microsoft Security blog: Search-MailboxAuditLog and New-MailboxAuditLogSearch will retire (updated February 18, 2026)
- Microsoft Learn: Search-MailboxAuditLog
- Microsoft Learn: Search-UnifiedAuditLog
- Microsoft Learn: Manage mailbox auditing
- Microsoft Learn: Search the audit log
- Microsoft Learn: Search the audit log to investigate common support issues
- Microsoft Learn: Investigate shared mailbox activities using audit logs
- Microsoft Learn: Use MailItemsAccessed to investigate compromised accounts
- Microsoft Learn: Manage audit log retention policies
- Microsoft Learn: Office 365 Management Activity API schema

Written by
Nafiul HasanNafiul Hasan is an entrepreneur and AI automation system builder with 10+ years of experience turning messy, manual workflows into reliable automated systems. He designs and ships AI enterprise solutions end-to-end — the agent logic, the data plumbing, and the product people actually use — and founded AI Emaily to give busy professionals their attention back. He writes here from the builder's seat: what works, what breaks, and how to put AI to work without giving up control.