Blog Post

Microsoft Security Community Blog
4 MIN READ

Important Announcement: Deprecation of AdminAuditLog and MailboxAuditLog Cmdlets

ColbyBoone's avatar
ColbyBoone
Icon for Microsoft rankMicrosoft
Jan 26, 2024

[UPDATE 4/18: We are writing to inform you that the AdminAuditLog & MailboxAuditLog changes that was scheduled for April 30th has been postponed until further notice. We apologize for any inconvenience this may cause you and we appreciate your patience and understanding]

 

[ Update 6/26]

Further details related to Admin Audit log Cmdlets Found here :

 https://aka.ms/AdminAuditCmdletBlog 

 

Dear customers, 

 

We are writing to inform you about an upcoming change that will affect the way you access and manage your Exchange Online audit logs. Starting from April 30, 2024, we will be deprecating the following four cmdlets in the Exchange Online V3 module: 

  • Search-AdminAuditLog 
  • Search-MailboxAuditLog 
  • New-AdminAuditLogSearch 
  • New-MailboxAuditLogSearch 

These cmdlets will no longer be available for use after this date, and you will need to switch to a Search-UnifiedAuditLog cmdlet or Microsoft Purview portal to access your audit logs. 

 

Why are we deprecating these cmdlets? 

We are working towards streamlining the audit log search experience of our customers by deprecating four older cmdlets in favor of a single, more powerful cmdlet: Search-UnifiedAuditLog. This cmdlet has been in use for a long time and offers several advantages, including: 

  • Support for a wider variety of record types. 
  • More filtering options to refine your search. 
  • A range of output formats to suit your needs. 

To make things simpler and more efficient, it’s recommended to use Search-UnifiedAuditLog from now on. You can learn more about this cmdlet and its usage here: Search-UnifiedAuditLog (ExchangePowerShell) | Microsoft Learn 

 

What do you need to do if you are using the deprecated cmdlets? 

If you are currently using any or all the above-mentioned cmdlets, you will need to take the following actions before April 30, 2024: 

 

For Search-AdminAuditLog, you will need to replace it with Search-UnifiedAuditLog in your scripts or commands. To get the same results as Search-AdminAuditLog, you will need to set the RecordType parameter to ExchangeAdmin. For example, if you want to search for all Exchange admin actions in the last 30 days, you can use the following command: 

Search-UnifiedAuditLog -RecordType ExchangeAdmin -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) 

 

For Search-MailboxAuditLog, you may also replace it with Search-UnifiedAuditLog. You can use the Exchange Online PowerShell V2 module to query the unified audit log for Exchange-related events. The cmdlet allows you to filter the results by record type, date range, user, and operation. For example, if you want to search for all Exchange mailbox actions in the last 30 days, you can use the following command:  
Search-UnifiedAuditLog -RecordType ExchangeItem -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) 

 

You can also export the results to a CSV file for further analysis. To use the cmdlet, you need to have the View-Only Audit Logs or Audit Logs role assigned. You can learn more about the cmdlet here: Search-UnifiedAuditLog.  

 

For New-MailboxAuditLogSearch and New-AdminAuditLogSearch you will need to use the Microsoft Purview portal to download your audit log report. The portal allows you to specify the criteria for your audit log search, such as date range, record type, user, and action. You can also choose to receive the report by email or download it directly from the portal. You can access the portal here: Microsoft Purview 

 

We are also working on a new Audit Search API using Microsoft Graph which is expected to become available in Public Preview by February 2024. This will allow our customers to programmatically access the new async Audit Search experience, which also provides improved reliability and search completeness. 

 

Note on default enablement of Auditing based on SKU:

To use the Search-UnifiedAuditLog command, auditing needs to be enabled for your tenant. Auditing is by default only enabled for the following SKUs: 

  • A1/A3/A5/Edu 
  • O365E1/E3/E5 
  • Defender 

If you are using any different SKU, you will need to enable the Auditing manually by following the steps as mentioned here: https://learn.microsoft.com/en-us/purview/audit-log-enable-disable. Please note To ensure you have access to the last 90 days of logs once the cmdlets are deprecated, it’s crucial to enable auditing before January 31st. If you enable auditing after this date, you’ll only have access to logs from the day you activate it and onwards.     

 

We are here to help 

We understand that this change may cause some inconvenience or disruption to your workflows, and we apologize for any inconvenience this may cause. We are committed to providing you with the best tools and services to manage your Exchange Online environment, and we appreciate your understanding and cooperation. 

 

If you have any questions or feedback about this change, please feel free to contact us through our support channels or post a comment on this blog post. We are always happy to hear from you and assist you in any way we can. 

 

Sincerely, 

The Exchange Online Team 

Updated Jun 26, 2024
Version 4.0

39 Comments

  • Will be excited to hear the responses about the valid issues raised here so far.  It seems I wasn't alone about noticing quite a difference between especially the mailbox audit logs vs universal audit logs.  Surely we can have the new way improved to match and exceed the quality of the old way!

  • JSC-HFT's avatar
    JSC-HFT
    Brass Contributor

    Been using this code provided by Microsoft years with great success.  UnifiedAudit log seraching does not provide this level of detail.  Bad move by Microsoft:

     

    https://learn.microsoft.com/en-us/microsoft-365/troubleshoot/audit-logs/mailbox-audit-logs

     

     

  • DATX's avatar
    DATX
    Copper Contributor

    ColbyBoone , we do business email compromise investigations for small businesses. In the past if the UAL was off we could still grab mailbox logs and admin audit logs. After this change goes through, if UAL is off, would we have none of that data available? 

    That would be hugely consequential for victims to understand what attackers did in their environment and be able to understand any legal implications. Would like to understand what would be available and how to get it, in instances where UAL is off.

  • MrPNutts_o365's avatar
    MrPNutts_o365
    Copper Contributor

    I just lost a long comment due to a problem with this site, so I'll summarize it as the unified log doesn't return all the details and events compared to Search-MailboxAuditLog. Losing that level of detail is going to significantly reduce the ability to troubleshoot.

  • Hi ColbyBoone,

    I've had instances with customers where "change user license" wasn't recorded at all and neither Search-UnifiedAuditLog cmdlet nor Microsoft Purview portal returned the activity. May I know if this cmdlet returns all events/activities made/performed by MS system/administrators?

    Is there any scenario where certain activity can't be audited and consequently can't be returned by these tools?

  • Xavier_P1150's avatar
    Xavier_P1150
    Copper Contributor

    Hi,

     

    We use Search-MailboxAuditLog to audit shared mailboxes. Search-UnifiedAuditLog doesn't seem to be able to do this. What do you suggest as an alternative via PS script?

  • Reposted in Exchange hub for visibility.  Updated comments to remove my complaint.  Should be fine with this change.

  • RaksChauhan's avatar
    RaksChauhan
    Brass Contributor

    We rely on the Search-MailboxAuditLog alot as its much better for reporting/audit logs on Shared Mailbox activity as they are not licences mailboxes versus the GUI-based Audit Search. We get values for the logged on user and the actions they perform against the Shared Mailbox. Can you recommend the best way to continue to achieve this using Search-MailboxAuditLog?