List Files Affected by SharePoint Online Retention Policies
Question details
The user needs a report identifying files affected by SharePoint Online retention policies, including file names, paths, and owners.

- Product
- SharePoint Online and Microsoft Purview
- Device & OS
- not provided
- Scenario
- The user is investigating retention policy coverage and wants to turn script output into a readable file report.
- Observed behavior
- The current PowerShell script returns identifiers but does not provide the desired file properties.
Gather the retention policy name, included SharePoint sites, retention settings, and the PowerShell script and sample output. Confirm that you have permission to inspect the policy and relevant SharePoint libraries, and remove sensitive information before sharing examples publicly.
Ask Microsoft Q&A for Help Resolving File Identifiers
Use Microsoft Q&A when a custom PowerShell report needs to map identifiers to SharePoint file properties.
In the Microsoft Purview portal, open Data lifecycle management and review the relevant Microsoft 365 retention policy. Note its SharePoint locations, retention period, and configured actions.
Review the PowerShell script and label each identifier in a sample output, such as a site, list, or item identifier. Include the command that generated it so specialists can determine how to resolve it.
Go to Microsoft Q&A and select Ask a question. Describe the policy scope, paste a sanitized script and sample output, and request file names, paths, and the specific owner or author property you need.
Run the suggested commands against a limited SharePoint site or library first, then compare the returned file names and paths with the library view.

Review Retention Policy Scope in Microsoft Purview
Check which SharePoint locations a policy targets before requesting or building a per-file report.
Review Document Reports with WPS Office
WPS Office is a free, lightweight alternative for working with documents and spreadsheet reports. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files into your workflow. It does not manage SharePoint retention policies or resolve their identifiers.

Frequently Asked Questions
Can I get a list of affected files directly from the retention policy settings?
The policy settings in Microsoft Purview show information such as locations and retention actions, but they are not a complete per-file report. A detailed inventory may require additional SharePoint queries and custom reporting.
Why does my PowerShell script return GUIDs instead of file names?
The commands may be returning identifiers for sites, lists, items, or other objects rather than file metadata. Share the specific commands and a sanitized sample of the output on Microsoft Q&A so the identifiers can be mapped to the appropriate SharePoint objects.
Does a retention policy mean every file in a site has been deleted?
No. A policy's scope and configured actions do not establish that an action has occurred on every file. Check the retention period and actions in Microsoft Purview, then investigate individual items as needed.
What is the difference between Microsoft Community and Microsoft Q&A for this issue?
Microsoft Community is suited to general product questions, while Microsoft Q&A is a better place to request help with PowerShell, SharePoint programming, and custom reporting. Include the script, policy settings, and desired report fields in your post.




