SharePoint Audit Log: Who Opened, Shared or Deleted a File?

The SharePoint audit log is part of Microsoft Purview Audit. It records who viewed, downloaded, edited, deleted or shared files, and who changed permissions, across SharePoint and OneDrive. Search it in the Microsoft Purview portal under Audit, or with the Search-UnifiedAuditLog cmdlet. Audit (Standard) is on by default and keeps records for 180 days; Audit (Premium) keeps SharePoint records for one year by default.

Published:

Last updated: 2026-12-02

What does the SharePoint audit log record?

Every audited action is stored as a record with the user, time, activity name, item and site. These are the activities SharePoint administrators search for most:

QuestionActivity (operation name)
Who opened this file?Accessed file (FileAccessed)
Who downloaded it?Downloaded file (FileDownloaded)
Who changed it?Modified file (FileModified)
Who deleted it?Deleted file (FileDeleted), deleted from Recycle Bin (FileDeletedFirstStageRecycleBin)
Who shared it, and how?Created a sharing invitation (SharingInvitationCreated), created an anonymous (Anyone) link (AnonymousLinkCreated), created a company shareable link (CompanyLinkCreated)
Who changed permissions?Shared file, folder, or site (SharingSet), added user or group to SharePoint group (AddedToGroup)
Who became a site admin?Added site collection admin (SiteCollectionAdminAdded)

How long are SharePoint audit records kept?

Audit (Standard)Audit (Premium)
Enabled by defaultYesYes
Default retention for SharePoint records180 daysOne year
Custom audit log retention policiesNoYes
Ten-year retentionNoYes, with an additional add-on license
CSV export limit per search50,000 rows1,000,000 rows

The Standard period was 90 days until October 17, 2023, when Microsoft changed it to 180 days. If you need history beyond these periods, export regularly or send audit data to another system through the Office 365 Management Activity API. Once a record ages out, it cannot be recovered.

How do you search the SharePoint audit log in Microsoft Purview?

  1. Make sure you hold the Audit Logs or View-Only Audit Logs role. Without one of them the Audit page will not return results.
  2. Open the Microsoft Purview portal and select Audit.
  3. Set the date and time range. Times are in UTC.
  4. In Activities - friendly names, choose the activities you need, for example "Accessed file" and "Downloaded file" under File and page activities.
  5. Optionally add Users, and enter all or part of a file name, folder or site URL in File, folder, or site.
  6. Select Search. The search runs as a job. Open it when it completes.
  7. Select a row to see the full record, or choose Export to download a CSV file.

Recent activity is not available instantly. Allow time after an event before concluding that it was not recorded.

How do you search the audit log with PowerShell?

Use Exchange Online PowerShell. This example lists everyone who opened or downloaded one document in the last 30 days:

Connect-ExchangeOnline

Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) `
    -RecordType SharePointFileOperation `
    -Operations FileAccessed, FileDownloaded `
    -ObjectIds "https://contoso.sharepoint.com/sites/finance/Shared Documents/Budget.xlsx" `
    -ResultSize 5000 |
  Select-Object CreationDate, UserIds, Operations |
  Export-Csv .\budget-access.csv -NoTypeInformation

And this one lists sharing activity on a site:

Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) `
    -RecordType SharePointSharingOperation `
    -ObjectIds "https://contoso.sharepoint.com/sites/finance/*" `
    -ResultSize 5000

The detail of each event is in the AuditData column as JSON. Convert it with ConvertFrom-Json to read fields such as the source file name, site URL and target user.

Why are events missing from the audit log?

  • The event is older than your retention period. 180 days for Standard, one year by default for Premium.
  • It has not been processed yet. Search again later.
  • The filter is too narrow. A file that was renamed or moved appears under its URL at the time of the event.
  • The result limit was reached. Narrow the date range or export in smaller periods.
  • The action is not a user action. When an application performs the activity, the record shows app@sharepoint as the user rather than a person.
  • You lack the role. Without Audit Logs or View-Only Audit Logs, searches return nothing.

What can't the audit log tell you?

The audit log is a history of events. It answers "who did this?" It does not answer "who can do this?"

QuestionAudit logPermissions report
Who opened this file last month?YesNo
Who can open this file today?NoYes
Which sharing links exist right now?Only links created within the retention periodYes, including old ones
What did permissions look like before a change?Individual change events onlyYes, if you saved an earlier report

For a typical investigation you need both: the current access picture and the activity history. SharePoint Essentials Toolkit reports current permissions, sharing links and external users across sites, and its compliance reports are mapped to SOC 2, ISO 27001, NIST 800-53 and CMMC controls, with a run record saved for auditors. Ranger365 (beta) keeps its own audit history of governance reviews and decisions.

Related reading: turning Purview audit searches into governance reports and how to run a SharePoint permissions report.

Frequently asked questions

Is SharePoint auditing turned on by default?

Yes. Microsoft Purview Audit (Standard) is enabled by default for Microsoft 365 organizations, and SharePoint and OneDrive activity is recorded without any per-site setup.

Can I see who viewed a SharePoint file?

Yes. Search the audit log for the "Accessed file" activity (FileAccessed) and filter on the file's URL. Results are limited to your audit retention period.

How far back does the SharePoint audit log go?

180 days with Audit (Standard) and one year by default with Audit (Premium). Longer retention needs Audit (Premium) retention policies, and ten years needs an add-on license.

Who can search the audit log?

People assigned the Audit Logs or View-Only Audit Logs role in the Microsoft Purview portal. A SharePoint administrator does not have this automatically.

Can I export SharePoint audit log results?

Yes. A completed search can be exported to CSV, up to 50,000 rows for Audit (Standard) and 1,000,000 rows for Audit (Premium). PowerShell results can be exported with Export-Csv.

Microsoft sources

This article is part of our Microsoft Purview for SharePoint guide.

See who can open your SharePoint files today, free

The audit log shows what happened. SharePoint Essentials Toolkit Community Edition shows who has access now: permissions, sharing links and external users, free on up to 20 sites per Microsoft 365 tenant. Get your free Community Edition license key.

About the author. The Cognillo SharePoint Team builds and supports SharePoint Essentials Toolkit and has worked with SharePoint administrators on permissions audits, migrations and cleanup projects since 2012.