TLDR
- Versions can consume a large percentage of the storage on the average tenant.
- Switching on automated version limiting (or manually limiting to a specific number) only affects new libraries, existing libraries need to be cleaned up if you want to save storage.
- Versions can be trimmed from individual files or libraries with PowerShell, but it requires a degree of technical knowledge and input time.
- SProbot can trim versions easily and quickly at scale with no technical expertise needed.
Requirements
Roles & Licensing
- SharePoint Administrator – Setting org-wide settings via PowerShell and via the SharePoint admin center.
- M365 Business or Enterprise License – Any Microsoft Business or Enterprise license that includes SharePoint P1 or P2.
Apps & Modules – Update setting via PowerShell
- PowerShell – There are several versions and ways to access PowerShell, in our guide we will use PowerShell ISE.
- PnP PowerShell module – This module is used to report on and delete the file versions. You will need the latest version installed and authorized for your user.
What is versioning?
Versioning in SharePoint is the automatic creation of a new copy of a file each time the file is edited. Each copy is considered a version and is stored within the original file. This enables users to track, manage and restore previous version of files stored within OneDrive and SharePoint.
The default number of versions stored in a SharePoint Online document library is 500.
Why do versions consume so much storage?
Versioning doesn't just store incremental changes - it generates a complete duplicate with every save.
This results in consistent storage growth regardless of whether the actual content modifications are minor or substantial between versions.
Consider a PPTX file that weighs in at 120MB for version 1. When a few high-resolution videos are embedded in version 2, the file balloons to 2.2GB. From that point forward, the marketing team only makes small adjustments and annotation updates - no new videos.
You might expect the storage impact to increase modestly from 2.2GB to perhaps 2.5GB over subsequent edits, but since each version produces a complete replica, every single save operation consumes another 2.2GB of space. With a team of 6 marketers making revisions twice weekly, this single file can exceed 1TB of storage consumption within 12 months!
How to prevent exorbitant version creation
SharePoint enables setup of automated version limits which uses an algorithmic approach to determine how many versions are reasonable for the specific library.
🔗Read more in our article How to save SharePoint storage with automated versioning.
What's the catch?
When configuring version history limits at a tenant level, only new SharePoint libraries will inherit the settings by default. Existing libraries are not affected by the tenant level changes.
This means if you want to free up storage space on existing SharePoint sites, you’ll need to roll up your sleeves and eliminate unnecessary versions. To do this manually would be far too labor intensive and prone to error. Below are ways to perform this cleanup in bulk.
How to trim versions in bulk
Method 1 – PnP PowerShell
To be able to report on and trim versions using PnP PowerShell, you will need to ensure the following:
- Access – The account performing the reporting and trimming will need to have a minimum of Member level access to the SharePoint site.
- Enable the Adding and Customize Pages – The site that where the library is hosted, the property on the site that the library is hosted the DenyAddAndCustomizePages property needs to be set to $false.
Step 1- Report on a file and its versions
To report on a file and its versions use the following command:
Get-PnPFileVersion -URL <File URL example: /shared documents/document.docx>

For a full report for your library, download the PowerShell script: Report on File Versions.ps1

Step 2 - Trim file versions
To trim file specific file versions use the following command:
Remove-PnPFileVersion -URL <File URL example: /shared documents/document.docx> -Id <Version ID>
*Note: This will remove a single version at a time and only move it to the recycle bin. If you want to skip the confirmation prompt and recycle bin, add the following at the end of the line:
-Recycle:$false -Force
To bulk trim file versions in a library, download the PowerShell script: Bulk trim File Versions.ps1. The list of versions to be trimmed will be the reviewed output file from the Report on File Versions.ps1 script.

Advantages
- Bulk actions – You are able to report on and trim versions in bulk.
Disadvantages
- Manual Reporting – Each list you want to report on, you will need to have the details of.
- Reports – The CSV reports generated are not user friendly and may cause issues when confirming the files and versions that need to be trimmed.
- Time Intensive – Using the bulk PowerShell scripts is quicker than manually trimming versions but is still time intensive.
- Technical – Requires someone with technical skills to perform the reporting and version trimming.
Method 2 – SProbot
Using the SProbot Sites with large files review enables you to identify sites on your tenant in which the crawl has found files >50MB, and for which versioning information has been automatically retrieved. You can then use the detailed large file report in each site to action items and instantly free up space.
Step 1 - View the total tenant-wide version consumption by large files
In the storage section of the Health Check, you can how much space is consumed by large files across all sites in the tenant, and what proportion of this space is latest vs all other versions.

Step 2 - Open the sites with large files review
To see which sites host the largest version spread of files, click through to it from Health Check, or select it from the list of available Reviews.

The default sort order highlights sites which contain the most versioning data, the All versions (GB) column.
To drill into detailed information for a specific site, open its preview and select to Manage this workspace.

Step 3 - View the detailed file report
Open the site's content tab to see the large, inactive and trivial file summaries. You can then use the detailed large file report to delete or trim versions.

Viewing the report shows that:
- There are 1362 files with a latest version over 50 MB
- The total latest version size of these 551 files is 177.19 GB
- The total size of all versions of these files is 768.72 GB
- There is an individual file with 39 versions which has a latest version size of 353MB, but an all versions size of over 57GB!

Step 4 - Trim versions
- Select the file(s) you want to trim versions for.
- Select Cleanup and the number of versions to keep.
- Confirm the number of versions you want to keep and that all others will be permanently deleted by typing in DELETE and then pressing the Delete button.

Your trimming action will be added to the queue and processed, and you can always go back to Reports > Activity history and view an audit trail of all previous trims.
* Note: Trimmed versions are not sent to the recycle bin, they are permanently deleted to make additional storage immediately available.
*Also note: You can alternately choose to delete the file entirely.
Advantages of version trimming with SProbot
- Report filters – The report filters target only the largest files to maximise the impact.
- Bulk actions – You are able to report on and trim versions in bulk, even targeting all files across all libraries in a site, its subsites and private/shared channel sites.
- User Interface – The user interface is easy to use and gives unique insights into which files are using the most storage.
- Quick Actions – Quickly action unneeded versions.
- Downloadable – Download a detailed report which can be used to identify files before actioning them.



















