Commands › Exchange Online
New-MailboxAuditLogSearch
> [!NOTE] > This cmdlet will be deprecated in the cloud-based service. To access audit log data, use the Search-UnifiedAuditLog cmdlet. For more information, see this blog post: <https://aka.ms/AuditCmdletBlog>. Use the New-MailboxAuditLogSearch cmdlet to search mailbox audit logs and have search results sent via email to specified recipients.
Quick start script
# New-MailboxAuditLogSearch — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org
# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-MailboxAuditLogSearch
$before | Format-List
# 3. Make the change (dry run first)
New-MailboxAuditLogSearch -EndDate <ExDateTime> -StartDate <ExDateTime> -StatusMailRecipients <MultiValuedProperty> -WhatIf
New-MailboxAuditLogSearch -EndDate <ExDateTime> -StartDate <ExDateTime> -StatusMailRecipients <MultiValuedProperty>
# 4. Verify and diff
$after = Get-MailboxAuditLogSearch
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax
New-MailboxAuditLogSearch -EndDate <ExDateTime> -StartDate <ExDateTime> -StatusMailRecipients <MultiValuedProperty>
[-Confirm]
[-DomainController <Fqdn>]
[-ExternalAccess <Boolean>]
[-GroupMailbox]
[-HasAttachments <Boolean>]
[-LogonTypes <MultiValuedProperty>]
[-Mailboxes <MultiValuedProperty>]
[-Name <String>]
[-Operations <MultiValuedProperty>]
[-ShowDetails]
[-WhatIf]
[<CommonParameters>]
Parameters (14)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.