I have used Search-UnifiedAuditLog Powershell command to view all SharePoint file operations (especially the file views) across all sites. Does anybody know how to filter results only to a given site collection? I need to be able to view all file views under a particular site collection.

As per the documentation, -ObjectIds parameter takes Site url as the parameter. But when I passed the site url, it only gives results for the home page excluding any children.

4 Answers 4

  1. On the Site actions menu Site Actions Menu , click Site settings.
  2. In the Site Collection Administration section, select Audit log reports.
  3. On the View Auditing Reports page, select the report that you want.
  4. Type or Browse to the library where you want to save the report and click OK.
  • Sorry, that doesn't give me enough details. Especially the file views. I am quite happy with what I get from "Search-UnifiedAuditLog", but just need to know how to filter for single site collection. Jun 16, 2017 at 3:50

I don't know how the output of Search-UnifiedAuditLog looks like, maybe filtering the output by using Select-String:

Search-UnifiedAuditLog .... | Select-String -Pattern <regexPattern>

If you provide an example output, then I could help with the regex.

Search-UnifiedAuditLog -StartDate 06/11/2017 -EndDate 06/14/2017 -SessionId "UnifiedAuditLogSearch3" -SessionCommand ReturnNextPreviewPage | Export-Csv "C:\result.csv"

The above commandlet is providing useful properties like Operations,UserId,RecordType. but our required data comes in AuditData property, below is the given format,


I am not able to sort it out the required data alone..

If a GUI tool is convenient for you then I would recommend 'AdminDroid Office 365 Reporter'.

There is a separate report in the tool to view all the activities related to SharePoint files. Further, this report allows you to setup a custom filter to view records specific to the particular site collection.

Steps to filter by site collection:

  1. Go to Audit > SharePoint > File Changes > All Activites, This will display the report of all the activities performed on your SharePoint files.

  2. Find the filter option above the table header (Filter option will be available only if you have any data in the report.) and choose 'Create Filter' option.

  3. This will show you the advanced filtering options. Just select 'Site URL' column and specify your site collection name and save the filter.

Now you can easily filter the changes as per site collection and you can schedule this report if you need to check this report periodically.

If you would like to check and confirm your requirement, checkout cool demo of this tool


Please follow the below steps to achieve:

  1. Go to Central Administration -> Manage Service Applications
  2. Choose Secure Store Service
  3. Then Click on the Properties in the Ribbon
  4. In the Enable Audit option Select the Check Box Audit Log Enabled
  5. Go to Site Settings -> Site Collection Administration -> Site Collection Audit Settings

Here are few more articles for your reference:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.