Fix File Not Found in SharePoint New-SPOListFileVersionExpirationReportJob
Question details
The user encounters a 'File Not Found' error when trying to generate a list version report using the New-SPOListFileVersionExpirationReportJob PowerShell cmdlet in SharePoint Online.
- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- Generating a list version expiration report via SharePoint Online PowerShell.
- Observed behavior
- The command fails to execute and returns a 'File Not Found' error, preventing the version report CSV file from being created.
Ensure you have the necessary SharePoint administrator permissions and that your PowerShell session is actively connected to your SharePoint Online admin center.
Specify an Existing Document Library in ReportUrl
Fix the error by ensuring the ReportUrl parameter points to a document library that already exists on your SharePoint Online site.
The 'File Not Found' error occurs because the path specified in the ReportUrl parameter does not exist. The New-SPOListFileVersionExpirationReportJob cmdlet cannot create new folders or libraries on the fly. If you provide a path like '/sites/Test/Reports/VersionReport.csv' but the 'Reports' library has not been created yet, the execution will fail.
Log in to your SharePoint Online site and identify an active, existing document library where you want to store the report (e.g., 'Shared Documents').
Modify your PowerShell script to use the valid path of the existing library. For example, change your parameter to -ReportUrl '/sites/YourSite/Shared Documents/VersionReport.csv'.
Execute the New-SPOListFileVersionExpirationReportJob command in PowerShell with the updated path to successfully generate the report.
Manage Your Exported SharePoint Reports with WPS Office
After successfully exporting your SharePoint list version reports as CSV files, use WPS Office to open, filter, and analyze your data. It is a lightweight, free alternative to Microsoft Office that offers full compatibility with spreadsheet formats.
- 1. Download and install: Download WPS Office from the official website and complete the quick installation process.
- 2. Open WPS Spreadsheet: Launch WPS Office and select the Spreadsheet module from the main dashboard.
- 3. Import your report: Click on 'File' > 'Open' and select the CSV file you exported from SharePoint to view and analyze your data.

Frequently Asked Questions
What is the New-SPOListFileVersionExpirationReportJob cmdlet used for?
This SharePoint Online PowerShell cmdlet generates a report detailing the file versions that are set to expire within a specific SharePoint document library or site.
Can the cmdlet create a new folder for the report automatically?
No, the destination path provided in the ReportUrl parameter must belong to a document library that already exists in SharePoint. The cmdlet will not create missing directories, which is why it throws a 'File Not Found' error.
Why isn't my CSV report appearing immediately after running the command?
Generating the version expiration report is processed as a background job in SharePoint Online. It may take some time to appear in your document library depending on the size of the list and the number of versions being processed.




