check audit log activities are enabled

Rising Flight 6,456 Reputation points
2025-11-12T13:37:56.78+00:00

Hi All,

How can we check if the following audit log activities have been enabled?

SearchQueryInitiatedSharePoint

SearchQueryInitiatedExchange

Please guide me.

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

0 comments No comments

Answer accepted by question author
Kha-N 8,265 Reputation points Microsoft External Staff Moderator
2025-11-17T04:33:15.26+00:00

Hi @RisingFlight,

Thank you very much for your response and update.

To assist you better, may I verify whether you have enabled SearchQueryInitiated in the mailbox’s AuditOwner actions for the user you want to track?

For example, if you want to check SearchQueryInitiatedSharePoint and SearchQueryInitiatedExchange audit logs for user1, you first need to enable SearchQueryInitiated on that user’s mailbox.

Set-Mailbox <user1@domain> -AuditOwner @{Add="SearchQueryInitiated"}

If you want to check which mailboxes have SearchQueryInitiated enabled, you can run this command below:

Get-Mailbox -ResultSize Unlimited |

  Select DisplayName,UserPrincipalName,AuditOwner |

  Where-Object { $_.AuditOwner -contains 'SearchQueryInitiated' }

This will display all mailboxes where SearchQueryInitiated is enabled.

User's image

After that, the user you are tracking must perform a search in Outlook (web or desktop) and on their SharePoint site.
User's image

Then in Purview, you can enter the operation name as I suggested previously, or use the event names SearchQueryInitiatedExchange and SearchQueryInitiatedSharePoint in the Operation Name field. I tested this approach, and it works successfully on my end. Additionally, you can specify users in the Users field to narrow the search and reduce processing time.

User's image

User's image If you prefer to use PowerShell as an alternative method, you can run the command below. It functions similarly to a Purview audit search and uses a 7-day time range:

Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date) -Operations SearchQueryInitiatedSharePoint,SearchQueryInitiatedExchange -UserIds <user1@domain>

This will return the relevant audit events, based on my testing:
User's image

User's image

I hope this helps. Feel free to give it a try and let me know if it works on your end. I’ll be happy to assist you further.

Warm thanks.

Was this answer helpful?


3 additional answers

Sort by: Most helpful
  1. Rising Flight 6,456 Reputation points
    2025-11-16T20:56:17.1166667+00:00

    i can see UnifiedAuditLogIngestionEnabled is already set to True in my environment but when i do audit search in purview i dont see any results please guide me.adminaudit

    Capture3

    Was this answer helpful?

    0 comments No comments

  2. Kha-N 8,265 Reputation points Microsoft External Staff Moderator
    2025-11-12T15:14:40.81+00:00

    Hi @RisingFlight,

    Welcome to Microsoft Q&A, and thank you very much for reaching out to us.

    Based on your description, as I checked, SearchQueryInitiatedSharePoint and SearchQueryInitiatedExchange do not have their own separate “enable” switch. These activities are part of the Unified Audit Log schema, so audit logging must be enabled globally to capture them.

    If you want to track these events for specific mailboxes, you can add SearchQueryInitiated to the audit actions for mailbox owners.
    User's image

    To check if Audit logging is enabled, you can run the following command in Exchange Online PowerShell to check if Unified Audit Log ingestion is enabled:

    Get-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabled
    

    If the result is True, audit logging is enabled, and these activities will be captured.

    If you want to check for these two activities specifically, you can check it by going to Microsoft Purview portal > Audit and search for the operation names:

    SharePointSearchQueryInitiatedand SearchQueryInitiated:

    User's image

    For more information, you can check on this Microsoft Article on how to search for Auditlog and AuditLog Activities here.

    I hope this help. If you have any additional questions or concern, kindly let me know. I would love to assist you further.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".     

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


  3. AI answer

    2025-11-12T13:38:49.5+00:00

    To check if the audit log activities for SearchQueryInitiatedSharePoint and SearchQueryInitiatedExchange have been enabled, you can use the following PowerShell command in Exchange Online:

    Set-Mailbox <user> -AuditOwner @{Add="SearchQueryInitiated"}
    

    You need to run this command for each user you want to check. If you want to verify the current settings for a specific user, you can retrieve the mailbox settings and look for the AuditOwner property to see if SearchQueryInitiated is listed.

    In a multi-geo environment, ensure that you run the command in the correct forest where the user's mailbox is located. If you need to remove the value from a user's mailbox, you can use:

    Set-Mailbox -AuditOwner @{Remove="SearchQueryInitiated"}
    

    This will help you manage and verify the auditing of search query activities in both SharePoint and Exchange Online.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.