-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
GitHub Action edited this page Jan 27, 2026
·
7 revisions
SPSCleanVersions.ps1 is a PowerShell script tool to clean Version History in your SharePoint Tenant. Optimize your storage costs by managing major and minor versions across libraries and lists.
Required for performance and class-based resource management. Installation guide.
This tool relies on the PnP.PowerShell module. Installation guide.
- Role: SharePoint Administrator or Global Administrator.
-
API Permissions:
Sites.FullControl.All(when using App Registration).
.\SPSCleanVersions.ps1 -SiteUrls @('https://contoso.sharepoint.com/sites/News') -KeepMajorVersions 50 -WhatIf.\SPSCleanVersions.ps1 -SiteUrls @('https://contoso.sharepoint.com/sites/News','https://contoso.sharepoint.com/sites/HR') -KeepMajorVersions 50 -WhatIfEnsure the provided credentials have access to the SharePoint Sites.
Test the script in a non-production environment before deploying it widely.
For issues or questions, please contact the script maintainer or refer to the project documentation.
Navigation
Project