How-to guide
How to See Who Viewed a SharePoint Document
Three ways to find out who opened a file in SharePoint Online, what each one really proves, and how we automated it for document reviews.
Written by Osmosys TeamPublished 6 min read

Short answer
Use one of two built-in tools. To see names on a file, a site owner turns on the SharePoint Viewers feature, and the names appear on the file card when you point at the file. For a dated record, someone with an audit role searches Microsoft Purview Audit for the Accessed file (FileAccessed) activity, which is kept for 180 days in Audit (Standard). Both record access. Neither proves that the person read the document.
On this page
Which method do you need?
Start with the question you have to answer. Each tool is right for one of these and wrong for the others.
| You need | Use | Who can do it |
|---|---|---|
| A quick look at who opened a file | SharePoint Viewers on the file card | A site owner turns it on |
| Totals for a site, without names | Site usage page | Site owners |
| A dated record you can export | Microsoft Purview Audit | Someone with the Audit Logs or View-Only Audit Logs role |
| A status for each reviewer that updates itself | Management Activity API with Power Automate | Someone who can register an app and get admin consent |
Method 1: Show viewer names on the file card
This is the simplest option, and it needs no audit role. Viewer names appear only when the setting is on in two places.
Check the organization setting
A SharePoint administrator opens the sharing settings and looks for Let site owners choose to display the names of people who viewed files or pages in SharePoint. Microsoft says it is on by default for the organization.
Turn on the site feature
The feature is off by default for existing sites. A site owner turns it on:
- Open the site information pane and select View all site settings.
- Under Site Actions, select Manage site features.
- Find SharePoint Viewers and select Activate.
After a few minutes, open the document library and point at a file. The file card shows who viewed it. Earlier views appear as well, including any from a period when the feature was switched off.
The site usage page is not a substitute. It reports how many people viewed content, and Microsoft states that individual names appear in the library hover card, not on that page.
Method 2: Search the audit log
Use this when you need to show who opened a file and when.
Before you start
- You need the Audit Logs or View-Only Audit Logs role in the Microsoft Purview portal.
- Audit (Standard) keeps records for 180 days. With Audit (Premium), SharePoint records are kept for one year by default.
- New events are not instant. Microsoft gives no guaranteed time, but says SharePoint records are typically available 60 to 90 minutes after the event.
Search in the Purview portal
- Open Audit in the Microsoft Purview portal and start a new search.
- Set the date range. The maximum is 180 days.
- Under Activities - friendly names, choose Accessed file.
- In File, folder, or site, enter the file name or part of its URL.
- Run the search, open the job when it finishes, and select Export for a CSV file. Exports hold up to 50,000 rows with Audit (Standard).
Search with PowerShell
For a report you run regularly, use Exchange Online PowerShell. For SharePoint, the object ID is the full URL of the file. The command follows Microsoft’s documentation, so try it on a short date range first.
Connect-ExchangeOnline
Search-UnifiedAuditLog `
-StartDate (Get-Date).AddDays(-30) `
-EndDate (Get-Date) `
-RecordType SharePointFileOperation `
-Operations FileAccessed `
-ObjectIds "https://contoso.sharepoint.com/sites/hr/Policies/Leave policy.docx" `
-ResultSize 5000 |
ForEach-Object { $_.AuditData | ConvertFrom-Json } |
Where-Object { $_.UserId -ne "app@sharepoint" } |
Sort-Object CreationTime |
Select-Object CreationTime, UserId, Operation, ObjectId, UserAgentOne call returns at most 5,000 results. For more, use -SessionId with -SessionCommand ReturnLargeSet and repeat the command with the same session until nothing comes back.
What a “view” in the audit log really means
Several events look like a view, and they do not mean the same thing. Mixing them up is an easy way to get a report wrong.
| Event | What Microsoft records | Count it as a view? |
|---|---|---|
FileAccessed | A user or system account accessed the file. It is not logged again for the same user and file for five minutes | Yes, after removing system accounts |
FileAccessedExtended | The same person kept accessing the file, for up to three hours | It is the same visit, so do not count it again |
FilePreviewed | A preview. High volumes can come from one action, such as viewing an image gallery | No |
FileDownloaded | The document was downloaded | Report it separately |
Three details from Microsoft’s documentation matter when someone will act on the result:
- Previews can be logged without anyone looking. Browser prefetch might log a
FilePreviewedevent, so its presence does not mean the preview appeared on a screen. - Intent is not recorded. Microsoft says both events mean that a user’s call led to a read of the file or of its thumbnail, and that the difference between them “isn’t a guarantee of the user’s intent”.
- Some entries are not people. The user
app@sharepointmeans that an application performed the action.
So the honest wording in a report is “opened on this date”, not “read”. If you need someone to confirm that they have read and understood a document, ask them to confirm it.
Method 3: Track it automatically
Searching works for one file. It does not work when a policy goes to 40 reviewers and somebody has to chase the ones who haven’t opened it.
We built a proof of concept for this. When a document reaches SharePoint, a Power Automate flow creates one tracking record for each reviewer. A second, scheduled flow collects access events from the Microsoft 365 Management Activity API, matches them to the assigned reviewers, and changes the matching records from Pending to Viewed.
When a document is uploaded
On a schedule
SharePoint tracking list
One record for each reviewer and document
Pendingchanges toViewed
What the API asks for
Register an application in Microsoft Entra ID, have a tenant administrator consent to it, and request a token that carries the ActivityFeed.Read permission. These requests follow Microsoft’s API reference. First, start a subscription to SharePoint events once:
POST https://manage.office.com/api/v1.0/{tenant_id}/activity/feed/subscriptions/start?contentType=Audit.SharePoint&PublisherIdentifier={tenant_id}
Authorization: Bearer {token}After that, each scheduled run lists the content that became available and downloads it:
GET https://manage.office.com/api/v1.0/{tenant_id}/activity/feed/subscriptions/content?contentType=Audit.SharePoint&startTime=2026-11-23T00:00&endTime=2026-11-23T12:00&PublisherIdentifier={tenant_id}
Authorization: Bearer {token}Limits to design for
These come from Microsoft’s API reference. Each one shapes the flow.
| Documented limit | What to do about it |
|---|---|
| The first content can take up to 12 hours to appear after you start a subscription | Start the subscription the day before you need it |
| Start and end times can be no more than 24 hours apart, and the start no more than 7 days ago | Run at least daily, and alert someone when a run fails |
A long list continues in a NextPageUri response header | Keep requesting until the header is absent |
| Events are not guaranteed to be in order | Match on the event’s own time, not its position |
Two recommendations of our own: let each run overlap the previous one, so a late event is not missed, and make the update safe to repeat, so a record that is already Viewed stays as it is.
How to check that it works
- Open a test document with a second account, not the owner’s.
- Wait at least 90 minutes before you expect an audit record.
- Search for that file and account, and confirm there is a
FileAccessedentry with the right time. - Open the same file again within five minutes. No second entry should appear.
- If you built tracking, run the scheduled flow twice and confirm that the record changes only once.
If nothing appears after a few hours, check your role, then the date range, then whether the file URL in your search matches the one in SharePoint.
Which one should you choose?
- One file, out of interest: turn on SharePoint Viewers.
- A question from management or an auditor: search Purview Audit, and export the result before the retention period ends.
- Regular reviews with named reviewers: automate it, and keep the word “Viewed” for what it is.
Whichever you use, tell people that access is recorded. Check your company’s policy and local rules on monitoring staff before you share names.
Sources
- Allow people to see who views their files or pages, Microsoft Support. Checked 24 November 2026.
- Manage sharing settings for SharePoint and OneDrive, Microsoft Learn. Checked 24 November 2026.
- View usage data for your SharePoint site, Microsoft Support. Checked 24 November 2026.
- Search the audit log, Microsoft Learn. Checked 24 November 2026.
- Audit log activities, Microsoft Learn. Checked 24 November 2026.
- Learn about auditing solutions in Microsoft Purview, Microsoft Learn. Checked 24 November 2026.
- Search-UnifiedAuditLog, Microsoft Learn. Checked 24 November 2026.
- Office 365 Management Activity API reference, Microsoft Learn. Checked 24 November 2026.
- Get started with Office 365 Management APIs, Microsoft Learn. Checked 24 November 2026.
- List of all premium tier connectors, Microsoft Learn. Checked 24 November 2026.
From our work
Related articles

Troubleshooting in Microsoft
How to Fix SharePoint Access Denied Errors
Match the exact SharePoint Online message to its cause, find out who can fix it, and solve access denied errors, including when the user already has permission.
, 8 min read
