Skip to content
Summa Lai
Never Stop Learning, Building a Little Wiki…
Life is like riding a bicycle. To keep your balance, you must keep moving. But DON'T move too fast.
  • Home
  • Apple
  • Cloud
  • Linux
  • Microsoft
  • Networks
  • Solutions
  • TOOLS
  • Log In
  • About Me

How to Search Audit Log in the Microsoft Purview Compliance Portal

Posted on July 13, 2023July 13, 2023 by Summa Lai

Need to find if a user viewed a specific document or purged an item from their mailbox? If so, you can use the audit log search tool in the Microsoft Purview compliance portal to search the unified audit log to view user and administrator activity in your organization. Thousands of user and admin operations performed in dozens of Microsoft 365 services and solutions are captured, recorded, and retained in your organization’s unified audit log. Users in your organization can use the audit log search tool to search for, view, and export (to a CSV file) the audit records for these operations.

 Tip

If you’re not an E5 customer, use the 90-day Microsoft Purview solutions trial to explore how additional Purview capabilities can help your organization manage data security and compliance needs. Start now at the Microsoft Purview compliance portal trials hub. Learn details about signing up and trial terms.

Microsoft 365 services that support auditing

Why a unified audit log? Because you can search the audit log for activities performed in different Microsoft 365 services. The following table lists the Microsoft 365 services, apps, and features that are supported by the unified audit log.

Microsoft 365 service or featureRecord types
Azure Active DirectoryAzureActiveDirectory, AzureActiveDirectoryAccountLogon, AzureActiveDirectoryStsLogon
Azure Information ProtectionAipDiscover, AipSensitivityLabelAction, AipProtectionAction, AipFileDeleted, AipHeartBeat
Communication complianceComplianceSupervisionExchange
Content explorerLabelContentExplorer
Data connectorsComplianceConnector
Data loss prevention (DLP)ComplianceDLPSharePoint, ComplianceDLPExchange, DLPEndpoint
Dynamics 365CRM
eDiscovery (Standard + Premium)Discovery, AeD
Encrypted message portalOMEPortal
Exact Data MatchMipExactDataMatch
Exchange OnlineExchangeAdmin, ExchangeItem, ExchangeItemAggregated
FormsMicrosoftForms
Information barriersInformationBarrierPolicyApplication
Microsoft 365 DefenderAirInvestigation, AirManualInvestigation, AirAdminActionInvestigation, MS365DCustomDetection
Microsoft Defender ExpertsDefenderExpertsforXDRAdmin
Microsoft Defender for Identity (MDI)MicrosoftDefenderForIdentityAudit
Microsoft PlannerPlannerCopyPlan, PlannerPlan, PlannerPlanList, PlannerRoster, PlannerRosterSensitivityLabel, PlannerTask, PlannerTaskList, PlannerTenantSettings
Microsoft Project for the webProjectAccessed, ProjectCreated, ProjectDeleted, ProjectTenantSettingsUpdated, ProjectUpdated, RoadmapAccessed,RoadmapCreated, RoadmapDeleted, RoadmapItemAccessed,RoadmapItemCreated,RoadmapItemDeleted, RoadmapItemUpdated, RoadmapTenantSettingsUpdated, RoadmapUpdated, TaskAccessed, TaskCreated,TaskDeleted, TaskUpdated
Microsoft Purview Information Protection (MIP) labelsMIPLabel, MipAutoLabelExchangeItem, MipAutoLabelSharePointItem, MipAutoLabelSharePointPolicyLocation
Microsoft TeamsMicrosoftTeams
Microsoft To DoMicrosoftToDo, MicrosoftToDoAudit
MyAnalyticsMyAnalyticsSettings
OneDrive for BusinessOneDrive
Power AppsPowerAppsApp, PowerAppsPlan
Power AutomateMicrosoftFlow
Power BIPowerBIAudit
QuarantineQuarantine
Sensitive information typesDlpSensitiveInformationType
Sensitivity labelsMIPLabel, SensitivityLabelAction, SensitivityLabeledFileAction, SensitivityLabelPolicyMatch
SharePoint OnlineSharePoint, SharePointFileOperation,SharePointSharingOperation, SharePointListOperation, SharePointCommentOperation
StreamMicrosoftStream
SystemSyncDataShareCreated, DataShareDeleted, GenerateCopyOfLakeData, DownloadCopyOfLakeData
Threat IntelligenceThreatIntelligence, ThreatIntelligenceUrl, ThreatFinder, ThreatIntelligenceAtpContent
Viva GoalsVivaGoals
Viva InsightsVivaInsights
YammerYammer

For more information about the operations that are audited in each of the services listed in the previous table, see the Audit log activities article.

The previous table also identifies the record type value to use to search the audit log for activities in the corresponding service using the Search-UnifiedAuditLog cmdlet in Exchange Online PowerShell or by using a PowerShell script. Some services have multiple record types for different types of activities within the same service. For a more complete list of auditing record types, see Office 365 Management Activity API schema.

For more information about using PowerShell to search the audit log, see:

  • Search-UnifiedAuditLog
  • Use a PowerShell script to search the audit log

Before you search the audit log

Be sure to review the following items before you start searching the audit log.

  • Audit log search is turned on by default for Microsoft 365 and Office 365 enterprise organizations. To verify that audit log search is turned on, you can run the following command in Exchange Online PowerShell:PowerShellCopyGet-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabled The value of True for the UnifiedAuditLogIngestionEnabled property indicates that audit log search is turned on. For more information, see Turn audit log search on or off. ImportantBe sure to run the previous command in Exchange Online PowerShell. Although the Get-AdminAuditLogConfig cmdlet is also available in Security & Compliance PowerShell, the UnifiedAuditLogIngestionEnabled property is always False, even when audit log search is turned on.
  • You have to be assigned the View-Only Audit Logs or Audit Logs role in Exchange Online to search the audit log. By default, these roles are assigned to the Compliance Management and Organization Management role groups on the Permissions page in the Exchange admin center. Global administrators in Office 365 and Microsoft 365 are automatically added as members of the Organization Management role group in Exchange Online. To give a user the ability to search the audit log with the minimum level of privileges, you can create a custom role group in Exchange Online, add the View-Only Audit Logs or Audit Logs role, and then add the user as a member of the new role group. For more information, see Manage role groups in Exchange Online.If you assign a user the View-Only Audit Logs or Audit Logs role on the Permissions page in the compliance portal, they won’t be able to search the audit log. You have to assign the permissions in Exchange Online. This is because the underlying cmdlet used to search the audit log is an Exchange Online cmdlet.
  • When an audited activity is performed by a user or admin, an audit record is generated and stored in the audit log for your organization. The length of time that an audit record is retained (and searchable in the audit log) depends on your Office 365 or Microsoft 365 Enterprise subscription, and specifically the type of the license that is assigned to specific users.
    • For users assigned an Office 365 E5 or Microsoft 365 E5 license (or users with a Microsoft 365 E5 Compliance or Microsoft 365 E5 eDiscovery and Audit add-on license), audit records for Azure Active Directory, Exchange, and SharePoint activity are retained for one year by default. Organizations can also create audit log retention policies to retain audit records for activities in other services for up to one year. For more information, see Manage audit log retention policies. NoteIf your organization participated in the private preview program for the one-year retention of audit records, the retention duration for audit records that were generated before the general availability rollout date will not be reset.
    • For users assigned any other (non-E5) Office 365 or Microsoft 365 license, audit records are retained for 90 days. For a list of Office 365 and Microsoft 365 subscriptions that support unified audit logging, see the security and compliance portal service description. NoteEven when mailbox auditing on by default is turned on, you might notice that mailbox audit events for some users aren’t found in audit log searches in the compliance portal or via the Office 365 Management Activity API. For more information, see More information about mailbox audit logging.
  • If you want to turn off audit log search for your organization, you can run the following command in Exchange Online PowerShell:PowerShellCopySet-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $false To turn on audit search again, you can run the following command in Exchange Online PowerShell:PowerShellCopySet-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $true For more information, see Turn off audit log search.
  • The underlying cmdlet used to search the audit log is an Exchange Online cmdlet, which is Search-UnifiedAuditLog. That means you can use this cmdlet to search the audit log instead of using the search tool on the Audit page in the compliance portal. You have to run this cmdlet in Exchange Online PowerShell. For more information, see Search-UnifiedAuditLog.For information about exporting the search results returned by the Search-UnifiedAuditLog cmdlet to a CSV file, see the “Tips for exporting and viewing the audit log” section in Export, configure, and view audit log records.
  • If you want to programmatically download data from the audit log, we recommend that you use the Office 365 Management Activity API instead of using a PowerShell script. The Office 365 Management Activity API is a REST web service that you can use to develop operations, security, and compliance monitoring solutions for your organization. For more information, see Office 365 Management Activity API reference.
  • Azure Active Directory (Azure AD) is the directory service for Microsoft 365. The unified audit log contains user, group, application, domain, and directory activities performed in the Microsoft 365 admin center or in the Azure management portal. For a complete list of Azure AD events, see Azure Active Directory Audit Report Events.
  • Microsoft doesn’t guarantee a specific time after an event occurs for the corresponding audit record to be returned in the results of an audit log search. For core services (such as Exchange, SharePoint, OneDrive, and Teams), audit record availability is typically 60 to 90 minutes after an event occurs. For other services, audit record availability may be longer. However, some issues that are unavoidable (such as a server outage) may occur outside of the audit service that delays the availability of audit records. For this reason, Microsoft doesn’t commit to a specific time.
  • To search for Power BI activities in the audit log, you have to enable auditing in the Power BI admin portal. For instructions, see the “Audit logs” section in Power BI admin portal.

Search the audit log

Here’s the process for searching the audit log in Microsoft 365.

  • Step 1: Run an audit log search
  • Step 2: View the search results
  • Step 3: Export the search results to a file

Step 1: Run an audit log search

  1. Go to https://compliance.microsoft.com and sign in. TipUse a private browsing session (not a regular session) to access the compliance portal because this will prevent the credential that you are currently logged on with from being used. Press CTRL+SHIFT+N to open an InPrivate Browsing session in Microsoft Edge or a private browsing session in Google Chrome (called an incognito window).
  2. In the left pane of the compliance portal, select Audit.The Audit page is displayed.Configure criteria and then select Search to run report. NoteIf the Start recording user and admin activity link is displayed, select it to turn on auditing. If you don’t see this link, auditing is turned on for your organization.
  3. On the Search tab, configure the following search criteria:
    1. Start date and End date: The last seven days are selected by default. Select a date and time range to display the events that occurred within that period. The date and time are presented in Coordinated Universal Time (UTC). The maximum date range that you can specify is 90 days. An error is displayed if the selected date range is greater than 90 days.
     TipIf you’re using the maximum date range of 90 days, select the current time for the Start date. Otherwise, you’ll receive an error saying that the start date is earlier than the end date. If you’ve turned on auditing within the last 90 days, the maximum date range can’t start before the date that auditing was turned on.
    1. Activities: Select the drop-down list to display the activities that you can search for. User and admin activities are organized into groups of related activities. You can select specific activities or you can select the activity group name to select all activities in the group. You can also select a selected activity to clear the selection. After you run the search, only the audit log entries for the selected activities are displayed. Selecting Show results for all activities displays results for all activities performed by the selected user or group of users.

      Over 100 user and admin activities are logged in the audit log. Select the Audited activities tab at the article of this article to see the descriptions of every activity in each of the different services.
    2. Users: Select in this box and then select one or more users to display search results for. The audit log entries for the selected activity performed by the users you select in this box are displayed in the list of results. Leave this box blank to return entries for all users (and service accounts) in your organization.
    3. File, folder, or site: Type some or all of a file or folder name to search for activity related to the file of folder that contains the specified keyword. You can also specify a URL of a file or folder. If you use a URL, be sure the type the full URL path or if you type a portion of the URL, don’t include any special characters or spaces (however, using the wildcard character (*) is supported).

      Leave this box blank to return entries for all files and folders in your organization.
     Tip
    • If you’re looking for all activities related to a site, add the wildcard character (*) after the URL to return all entries for that site; for example, "https://contoso-my.sharepoint.com/personal*".
    • If you’re looking for all activities related to a file, add the wildcard character (*) before the file name to return all entries for that file; for example, "*Customer_Profitability_Sample.csv".
  4. Select Search to run the search using your search criteria.The search results are loaded, and after a few moments they’re displayed on a new page. When the search is finished, the number of results found is displayed. A maximum of 50,000 events are displayed in increments of 150 events. If more than 50,000 events meet the search criteria, only the 50,000 unsorted events returned are displayed.The number of results are displayed after the search is finished.

Tips for searching the audit log

  • You can select specific activities to search for by selecting the activity name. Or you can search for all activities in a group (such as File and folder activities) by selecting the group name. If an activity is selected, you can select it to cancel the selection. You can also use the search box to display the activities that contain the keyword that you type.Select activity group name to select all activities.
  • You have to select Show results for all activities in the Activities list to display events from the Exchange admin audit log. Events from this audit log display a cmdlet name (for example, Set-Mailbox) in the Activity column in the results. For more information, select the Audited activities tab in this article and then select Exchange admin activities.Similarly, there are some auditing activities that don’t have a corresponding item in the Activities list. If you know the name of the operation for these activities, you can search for all activities, then filter the operations after you export the search results to a CSV file.
  • Select Clear to clear the current search criteria. The date range returns to the default of the last seven days. You can also select Clear all to show results for all activities to cancel all selected activities.
  • If 50,000 results are found, you can probably assume that there are more than 50,000 events that met the search criteria. You can either refine the search criteria and rerun the search to return fewer results, or you can export the 50,000 search results by selecting Export results > Download all results.

Step 2: View the search results

The results of an audit log search are displayed under Results on the Audit log search page. As previously stated, a maximum of 50,000 (newest) events are displayed in increments of 150 events. Use the scroll bar or press Shift + End to display the next 150 events.

The results contain the following information about each event returned by the search:

  • Date: The date and time (in UTC) when the event occurred.
  • IP address: The IP address of the device that was used when the activity was logged. The IP address is displayed in either an IPv4 or IPv6 address format. NoteFor some services, the value displayed in this field might be the IP address for a trusted application (for example, Office on the web apps) calling into the service on behalf of a user and not the IP address of the device used by person who performed the activity. Also, for admin activity (or activity performed by a system account) for Azure Active Directory-related events, the IP address isn’t logged and the value displayed in this field is null.
  • User: The user (or service account) who performed the action that triggered the event.
  • Activity: The activity performed by the user. This value corresponds to the activities that you selected in the Activities drop down list. For an event from the Exchange admin audit log, the value in this column is an Exchange cmdlet.
  • Item: The object that was created or modified as a result of the corresponding activity. For example, the file that was viewed or modified or the user account that was updated. Not all activities have a value in this column.
  • Detail: Additional information about an activity. Again, not all activities have a value.

 Tip

Select a column header under Results to sort the results. You can sort the results from A to Z or Z to A. Select the Date header to sort the results from oldest to newest or newest to oldest.

View the details for a specific event

You can view more details about an event by selecting the event record in the list of search results. A flyout page is displayed that contains the detailed properties from the event record. The properties that are displayed depend on the service in which the event occurs.

Step 3: Export the search results to a file

You can export the results of an audit log search to a comma-separated value (CSV) file on your local computer. You can open this file in Microsoft Excel and use features such as search, sorting, filtering, and splitting a single column (that contains multiple properties) into multiple columns.

  1. Run an audit log search, and then revise the search criteria until you have the desired results.
  2. On the search results page, select Export > Download all results.All entries from the audit log that meet the search criteria are exported to a CSV file. The raw data from the audit log is saved to a CSV file. Additional information from the audit log entry is included in a column named AuditData in the CSV. ImportantYou can download a maximum of 50,000 entries to a CSV file from a single audit log search. If 50,000 entries are downloaded to the CSV file, you can probably assume there are more than 50,000 events that met the search criteria. To export more than this limit, try using a date range to reduce the number of audit log entries. You might have to run multiple searches with smaller date ranges to export more than 50,000 entries.
  3. After the export process is complete, a message is displayed at the top of the window that prompts you to open the CSV file and save it to your local computer. You can also access the CSV file in the Downloads folder.

More information about exporting and viewing audit log search results

  • When you download all search results, the CSV file contains the columns CreationDate, UserIds, Operations, and AuditData. The AuditData column contains additional information about each event (similar to the detailed information displayed on the flyout page when you view the search results in the compliance portal). The data in this column consists of a JSON object that contains multiple properties from the audit log record. Each property:value pair in the JSON object is separated by a comma. You can use the JSON transform tool in the Power Query Editor in Excel to split AuditData column into multiple columns so that each property in the JSON object has its own column. This lets you sort and filter on one or more of these properties. For step-by-step instructions using the Power Query Editor to transform the JSON object, see Export, configure, and view audit log records.After you split the AuditData column, you can filter on the Operations column to display the detailed properties for a specific type of activity.
  • When you download all results from a search query that contains events from different services, the AuditData column in the CSV file contains different properties depending on which service the action was performed in. For example, entries from Exchange and Azure AD audit logs include a property named ResultStatus that indicates if the action was successful or not. This property isn’t included for events in SharePoint. Similarly, SharePoint events have a property that identifies the site URL for file and folder-related activities. To mitigate this behavior, consider using different searches to export the results for activities from a single service.For a description of many of the properties that are listed in the AuditData column in the CSV file when you download all results, and the service each one applies to, see Detailed properties in the audit log.

Scoping access to audit logs (preview)

Access to search the audit log is scoped based upon the administrative units assigned to the user accessing the audit log in the compliance portal. A restricted admin can only search and export user-generated audit logs within the scope of their administrative units. An unrestricted admin has access to all audit logs, including logs generated by non-user and system accounts.

Admin units assigned to adminsAdmin units available to perform scoped search onAccess to search and export audit logs
None (Default): Unrestricted adminAll administrative units are availableAccess to all activity logs from any user, non-user, or system account.
One or more administrative units: Restricted adminOnly those administrative units assigned to the admin are availableAccess to activity logs from users with a matching administrative unit assignment.

 Note

The Search-MailboxAuditLog and Search-AdminAuditLog cmdlets currently do not support scoped access. Search requests using these cmdlets always include unscoped activity logs from Exchange, even when the user performing the search is a scoped admin. To access scoped activity logs from any Microsoft service, including Exchange mailbox activity logs, use the Search-UnifiedAuditLog cmdlet.

For more information about administrative units, see Permissions in the Microsoft Purview compliance portal.

Ref: https://learn.microsoft.com/en-us/microsoft-365/compliance/audit-log-search?view=o365-worldwide

Posted in Azure, Cloud, Microsoft 365, Microsoft Family Tagged Audit Log in the Microsoft Purview, Search Audit Log in the Microsoft Purview Compliance Portal

Post navigation

← How to Disable Weak Cipher Suites in IIS
How to Secure and Restore a Compromised Microsoft 365 Mailbox →

Categories

  • About Me (1)
  • Apple (24)
    • Apple Devices (18)
    • iCloud (3)
    • Mac OS (7)
  • Certifications (21)
    • CCNP (21)
    • CompTIA A+ (2)
    • CompTIA Network+ (9)
  • Cloud (79)
    • AWS (2)
    • CloudFlare (2)
    • Google Cloud (19)
    • JumpCloud (1)
    • Microsoft 365 (48)
    • Oracle (1)
    • RADIUS (2)
  • Linux Family (57)
    • Apache (20)
    • CentOS (23)
    • PHP (3)
    • Putty / WinSCP (1)
    • Shopify (2)
    • WordPress (18)
  • Microsoft Family (537)
    • Autopilot / Intune (52)
    • Azure (94)
    • Compliance Portal (3)
    • Dymanic (2)
    • Exchange (13)
    • Hyper-V (1)
    • Microsoft Defender (6)
    • Microsoft Office (172)
    • Power BI (94)
    • PowerShell (15)
    • SQL (20)
    • Surface (3)
    • Teams / SharePoint (20)
    • Windows 7/8/10/11 (133)
    • Windows Servers (70)
  • Networks (122)
    • Adobe (1)
    • Darktrace (2)
    • Firewalls (21)
    • Google (12)
    • Hardware (21)
    • Meraki (1)
    • Mobile phones (5)
    • NordLayer (1)
    • Others (24)
    • Palo Alto (11)
    • Phones (1)
    • Router/Switch (26)
    • Ubiquiti (1)
    • Wi-Fi (9)
  • Oversea Living (26)
  • Solutions (50)
    • 1Password (2)
    • Adobe (2)
    • BI and Reporting (5)
    • eCommerce (8)
    • Forensics / Investigation (1)
    • Google Workspace (4)
    • IT Management (2)
    • KnowBe4 (1)
    • Password Management (5)
    • Project Management (2)
    • QuickBooks (1)
    • Sage (3)
  • Tools (15)
    • Atera (2)
    • Chocolatey (1)
    • Google (4)
    • PatchMyPC (3)
  • Travels (2)
  • Uncategorized (13)
  • VMware (2)

Recent Posts

  • Password Expiration Notification for Microsoft 365 Users May 1, 2025
  • How to Fix “Your organization does not allow external forwarding.” Microsoft 365 April 9, 2025
  • How to Check the Windows 11 Version and Build March 25, 2025
  • How to Remove Previously Granted Access to a User’s OneDrive February 13, 2025
  • How to Create a Milestone with Project for The Web February 4, 2025
  • How To Convert a .CRT Certificate into a .PEM or .PFX Format January 6, 2025
  • How to Deploy 1Password SCIM Bridge on Azure Container Apps January 2, 2025
  • How to Send Email Notifications When PING Fails December 14, 2024
  • How to Fix “We Couldn’t Update the System Reserved Partition” Error on Windows 10/11 December 9, 2024
  • How to Fix “Printer Failure” Error on HP OfficeJet Pro 8610 November 27, 2024

Recent Comments

  • buy CBD on SUMMA LAI – NEVER STOP LEARNING

Archives

  • May 2025 (1)
  • April 2025 (1)
  • March 2025 (1)
  • February 2025 (2)
  • January 2025 (2)
  • December 2024 (2)
  • November 2024 (3)
  • October 2024 (4)
  • September 2024 (3)
  • August 2024 (7)
  • July 2024 (7)
  • June 2024 (4)
  • May 2024 (4)
  • April 2024 (1)
  • March 2024 (5)
  • February 2024 (7)
  • January 2024 (12)
  • December 2023 (7)
  • November 2023 (11)
  • October 2023 (8)
  • September 2023 (8)
  • August 2023 (6)
  • July 2023 (12)
  • June 2023 (15)
  • May 2023 (17)
  • April 2023 (18)
  • March 2023 (14)
  • February 2023 (17)
  • January 2023 (21)
  • December 2022 (17)
  • November 2022 (20)
  • October 2022 (18)
  • September 2022 (17)
  • August 2022 (17)
  • July 2022 (17)
  • June 2022 (18)
  • May 2022 (12)
  • March 2022 (11)
  • February 2022 (18)
  • January 2022 (22)
  • December 2021 (26)
  • November 2021 (22)
  • October 2021 (23)
  • September 2021 (24)
  • August 2021 (12)
  • July 2021 (14)
  • June 2021 (20)
  • May 2021 (23)
  • April 2021 (28)
  • March 2021 (24)
  • February 2021 (27)
  • January 2021 (28)
  • December 2020 (31)
  • November 2020 (13)
  • October 2020 (4)
  • September 2020 (3)
  • August 2020 (7)
  • July 2020 (23)
  • June 2020 (24)
  • May 2020 (21)
Copyright 2024, Privacy Policy
  • SUMMA LAI – NEVER STOP LEARNING