Switch to UnifiedAuditLog from MailboxAuditLog (and AdminAuditLog)
Microsoft is going to retire Audit Log cmdlets from the 'Exchange Online PowerShell' module starting from September 2024. Instead, they recommend using the Unified Audit Log (UAL) for auditing.
- MailboxAuditLog: The Mailbox Audit Log cmdlets will have a separate deprecation date, which will be announced early next year.
- AdminAuditLog: Two Admin Audit Log cmdlets,
Search-AdminAuditLog
andNew-AdminAuditLog (New-AdminAuditLogSearch)
, will retire on September 15, 2024. It's recommended to useSearch-UnifiedAuditLog
instead.
Overview of Cmdlets
Search-MailboxAuditLog
is still unannounced for an updated deprecation date? Correct, there is no known deprecation date.Search-AdminAuditLog
will be removed in September this year.
Cmdlet | Module | Deprecation |
---|---|---|
Search-AdminAuditLog, New-AdminAuditLogSearch | ExchangeOnlineManagement | Yes (EOL1: April 2024 > Sept 2024) |
Search-MailboxAuditLog, New-MailboxAuditLogSearch | ExchangeOnlineManagement | Yes (EOL1: April 2024 > TBD) |
Search-UnifiedAuditLog | ExchangeOnlineManagement | No |
How to use UnifiedAuditLog
The Unified Audit Log is stored for 180 days2 and the usage of this new cmdlet has slightly changed in terms of available Attributes and generated output.
The default retention period for Audit (Standard) has changed from 90 days to 180 days. Audit (Standard) logs generated before October 17, 2023 are retained for 90 days. Audit (Standard) logs generated on or after October 17, 2023 follow the new default retention of 180 days.
Preparation (PowerShell)
To begin using 'ExchangeOnlineManagement PowerShell' and accessing the 'Unified Audit Log,' you need to follow these preparatory steps. These cmdlets will allow you to verify whether auditing is enabled on the tenant:
1 2 3 4 5 |
|
Audit Logs Types
There are different types of Logs which are being tracked for Exchange:
LogType (Area) | RecordType | Description |
---|---|---|
MailboxAuditLog | ExchangeItem | Events from an Exchange mailbox audit log for actions that are performed on a single item, such as creating or receiving an email message. |
MailboxAuditLog | ExchangeItemGroup | Events from an Exchange mailbox audit log for actions that can be performed on multiple items, such as moving or deleted one or more email messages. |
MailboxAuditLog | ExchangeItemAggregated | Events related to the MailItemsAccessed mailbox auditing action. |
AdminAuditLog | ExchangeAdmin | Events from the Exchange admin audit log. |
Solution A for UserMailbox
In the previous MailboxAuditLog, you could request multiple log types simultaneously and receive a consolidated output. However, from what I understand, this is no longer possible. Now, you must request either all log types or one at a time. Additionally, the default output is limited to 100 entries, which typically requires adjustment. Please make sure that Auditing has earlier been Enabled on the Mailbox you request.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
Solution B for SharedMailbox
Since the transition to the UnifiedAuditLog, I've noticed that Shared Mailboxes are sometimes excluded from the output. To retrieve their data, you need to use the 'FreeText' attribute along with the corresponding 'ExchangeGuid'. It could be useful to find out whether the '-UserIds' parameter works for Shared Mailboxes that are licensed (active archive).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Solution C for ExchangeAdmin
The process for retrieving Admin Logs follows a similar schema to that of user logs. The primary difference is that you need to specify the appropriate log type. By changing the log type, you should be able to view all administrative actions performed through the Exchange Admin Center or Exchange PowerShell. This approach ensures comprehensive visibility into any modifications or configurations carried out by administrators.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Summary
I see the reason in combining this log types and probably also simplify background infrastructure to provide long-term storage capabilities. For me, it still feels a bit like data engineering when searching, and I wish to see more attributes to filter and less JSON Objects inside of PowerShell. Wish you all a good day and success in finding your entries.
References:
- Update on the Deprecation of Admin Audit Log Cmdlets, Jun 20 2024 09:50
- Update on the Deprecation of Admin Audit Log Cmdlets, Jun 20 2024 09:30
- Important Announcement: Deprecation of AdminAuditLog and MailboxAuditLog Cmdlets: https://aka.ms/AuditCmdletBlog
- Update on the Deprecation of Admin Audit Log Cmdlets https://aka.ms/AdminAuditCmdletBlog
- Turn auditing on or off
- MC856760 - Reminder: Two Admin Audit Log cmdlets retire in September 2024
- MC775358 - Microsoft Purview | Audit: New HighCompleteness parameter in Search-UnifiedAuditLog Audit cmdlet
- PowerShell Gallery: ExchangeOnlineManagement