Answer in brief
To trim existing SharePoint versions, queue a trim job in PowerShell: New-SPOSiteFileVersionBatchDeleteJob for one site (free), or New-SPOTenantApplyFileVersionPolicyJob -TrimVersions for every site at once (public preview, needs a SharePoint Advanced Management or Copilot licence). Changing version limits on its own doesn't remove the versions already stored, and trimmed versions are deleted permanently, so estimate the impact before you run anything.
There are seven routes. This guide covers what each one needs, how long it takes and what can go wrong:
- Version limits: new versions only
- Site and library trim jobs
- The version usage report and What-If analysis
- Tenant-level trimming (public preview)
- The Apply-SPOVersions-Tool script
- PnP PowerShell, file by file
- Without the scripts: SProbot
Microsoft's routes were last verified against Microsoft Learn on 12 November 2026.
Which route should you use to trim SharePoint versions?
Use version limits to control new versions, a site or library trim job for a few large sites, and tenant-level trimming if you have a SharePoint Advanced Management or Copilot licence and want one policy across every site. Use SProbot if you want to see the savings per site in dollars and run bulk trim jobs without scripts.
| Route | Licence | Hands-on work | Simulation first? | Savings in money? |
|---|---|---|---|---|
| Version limits | Included | A setting in the admin center | No | No |
| Site or library trim job | Included | One command per site, plus progress checks | Only with the What-If report | No |
| Version usage report and What-If | Included | Per site: report job, CSV download, scripts, Excel | This is the simulation | No (sizes in bytes) |
| Tenant-level trimming (public preview) | SharePoint Advanced Management or Copilot | Data collection, an impact estimate and a trim job to run and monitor, with one policy for every site | Yes, tenant-wide estimate | No |
| Apply-SPOVersions-Tool script | Included | App registration and admin rights on every site, then a menu | Yes, per site | No |
| PnP PowerShell, file by file | Included | Per library: report, review the CSV, run the script | No, a report only | No |
| SProbot | $235 per TB a year (free 14-day trial) | About 15 minutes of your time | Yes, savings per site | Yes, in dollars |
Every route that trims takes days of elapsed time on a large tenant. What differs is how much of that time is yours.
Why do old versions take so much SharePoint storage?
Each version of a file counts toward your storage at the file's full size, and a library keeps up to 500 major versions by default. A large file that's edited often can therefore take many times its visible size.
In the example site below, the large files report shows:
- 1,362 files with a latest version over 50 MB
- 177.19 GB for the latest versions of those files
- 768.72 GB for all their versions, so 592 GB is old versions
- One 353 MB file with 39 versions that takes over 57 GB in total

That's why the biggest wins come from large files that people are still editing, not from trimming every library evenly.
What can go wrong when you trim SharePoint versions?
- Trimming is permanent. Versions deleted by a trim job skip the recycle bin. Microsoft says they can't be recovered unless you backed them up with Microsoft 365 Backup or a similar tool.
- Jobs run for days. Trim jobs are background jobs. They delete versions in batches and are subject to off-peak processing.
- Retention and holds block trimming. A trim job doesn't delete a version that's under a retention policy or an eDiscovery hold. It stamps an expiration date on it instead, and the version goes only once the retention ends. Users and scripts can't delete those versions either.
- Estimates ignore retention. Microsoft's tenant-level estimate doesn't account for retention policies, retention labels or holds, so the storage you get back can be less than predicted.
- People rely on versions. Agree with site owners how many versions they need for recovery before you remove any. SharePoint version history cleanup: what to remove, what to keep covers that decision.
If trimming is one part of a wider storage project, the SharePoint cleanup checklist for IT admins puts it in order with the other work.
Can you bulk delete SharePoint version history safely?
Yes, if you measure first, agree what to keep and test on a small scope. It becomes unsafe when one age or count rule goes across the whole tenant before you know where records, recovery needs and retention differ.
- Find where version storage is concentrated: the sites, libraries and large files with the most old versions.
- Agree with site owners how many versions, or how many days of history, they need for recovery.
- Check retention policies, retention labels and eDiscovery holds with your compliance team.
- Estimate the impact with the What-If analysis or the tenant-level estimate.
- Test the rule on a small, low-risk site and check the result.
- Record the rule, the scope, the date and who approved it, then run the trim and monitor it.
Then set version limits so the old versions don't build back up.
1. Version limits: new versions only
Version limits control how many versions SharePoint keeps from now on. They don't clear the versions you already have. You can set a fixed count, a count with an expiry period, or Automatic, which thins out older versions over time.
- What it needs: a SharePoint Administrator. Set the organisation default in the SharePoint admin center under Settings > Version history limits, or set limits per site or per library.
- How long it takes: minutes to set.
- What can go wrong: an organisation-level change applies only to libraries created afterwards. Lowering a count limit on an existing library does trim older versions, but only about 20 at a time, each time a file is edited, so files nobody edits keep everything. A new expiry period applies to new versions only.
Set limits so storage doesn't grow back, then use one of the routes below for what's already there. See How to save SharePoint storage with automated versioning and SharePoint version limits: how to choose a safe policy.
2. Site and library trim jobs
A trim job deletes existing versions in one site, one library or one OneDrive account. It has three modes: Automatic, by age, or by count.
# Automatic: apply Microsoft's automatic algorithm
New-SPOSiteFileVersionBatchDeleteJob -Identity $siteUrl -Automatic
# By age: delete versions older than 180 days
New-SPOSiteFileVersionBatchDeleteJob -Identity $siteUrl -DeleteBeforeDays 180
# By count: keep the newest 100 major versions
New-SPOSiteFileVersionBatchDeleteJob -Identity $siteUrl -MajorVersionLimit 100 -MajorWithMinorVersionsLimit 0
# One library only
New-SPOListFileVersionBatchDeleteJob -Site $siteUrl -List "Documents" -Automatic
# Check progress, or stop the job
Get-SPOSiteFileVersionBatchDeleteJobProgress -Identity $siteUrl
Remove-SPOSiteFileVersionBatchDeleteJob -Identity $siteUrl- What it needs: a SharePoint Administrator and the latest SharePoint Online Management Shell. No extra licence.
- How long it takes: one command to queue. Microsoft then deletes the versions "asynchronously in batches in the upcoming days".
- What can go wrong: it works one site at a time, so a whole tenant means a loop you write and monitor yourself. The by-age mode can't go below 30 days and always deletes every version created before 1 January 2023. Stopping a job doesn't bring back what it has already deleted. There's no estimate unless you run the What-If analysis first.
Microsoft's reference: Trim existing versions and Tutorial: Queue a trim job.
3. The version usage report and What-If analysis
This is Microsoft's way to see what a trim job would delete before you run it. It trims nothing itself.
# Generate the report as a CSV in a document library
New-SPOSiteFileVersionExpirationReportJob -Identity $siteUrl -ReportUrl "$siteUrl/Shared Documents/VersionReport.csv"
# Check until the status is "completed"
Get-SPOSiteFileVersionExpirationReportJobProgress -Identity $siteUrl -ReportUrl "$siteUrl/Shared Documents/VersionReport.csv"You then download the CSV, run one of Microsoft's scripts to model a trim mode (ScheduleUpdate_Auto.ps1, ScheduleUpdate_ExpireAfter.ps1 or ScheduleUpdate_Count.ps1), and analyse the result with AnalyzeReportFile.ps1 or Microsoft's Excel template. The analysis shows which versions would expire, how much version storage that is and which users are affected.
- What it needs: the SharePoint Online Management Shell for the report, PowerShell 7 for the scripts, and Excel if you use the template.
- How long it takes: Microsoft says the report job "can take a few days to complete" on a large site. The analysis is manual work for each site.
- What can go wrong: it's one CSV per site or library, with a row for every version, so large sites produce very large files. Sizes are in bytes, and nothing is shown as a cost.
Microsoft's reference: Tutorial: Generate a version usage report and Tutorial: Run What-If analysis.
4. Tenant-level trimming (public preview)
To trim existing versions across your whole tenant in one job, use New-SPOTenantApplyFileVersionPolicyJob. It applies your tenant-level version policy to every site, and it's the only Microsoft route with a built-in tenant-wide estimate. It's in public preview and requires a SharePoint Advanced Management licence or a Copilot licence.
# 1. Check the tenant-level version policy
Get-SPOTenantVersionPolicy
# 2. Collect version data (deletes nothing), then wait for it to finish
New-SPOTenantApplyFileVersionPolicyJob -CollectVersionData
Get-SPOTenantApplyFileVersionPolicyJobProgress
# 3. Estimate the impact, here for a 50-version limit
$policy = Get-SPOTenantVersionPolicy | Get-SPOVersionPolicyWithChanges -MajorVersionLimit 50
Get-SPOTenantApplyFileVersionPolicyJobImpact -VersionPolicy $policy
# 4. Trim existing versions and set the policy on existing libraries
New-SPOTenantApplyFileVersionPolicyJob -TrimVersions -SetVersionPolicy
# Cancel if needed
Remove-SPOTenantApplyFileVersionPolicyJob- What it needs: a SharePoint Administrator, the latest SharePoint Online Management Shell, and the licence. Microsoft's licensing page says SharePoint admins get SharePoint Advanced Management features once the organisation assigns at least one Copilot licence.
- How long it takes: data collection, an impact estimate and then the trim job, each to run and monitor. Microsoft gives no duration for the data collection or the trim. The estimate covers SharePoint sites and OneDrive accounts.
- What can go wrong: only one job can run per tenant at a time. Read-only, locked and archived sites are skipped, and so are sites where version policy inheritance is broken. The estimate ignores retention and holds. It applies one policy everywhere, so you can't trim only the files where versions cost the most. Multi-geo tenants run it once per geo. As a preview it can change, and Microsoft has said it may add throttling limits.
Microsoft's reference: Trim existing versions. For what else the licence covers for storage, see SharePoint Advanced Management vs third-party tools.
5. The Apply-SPOVersions-Tool script
Apply-SPOVersions-Tool.ps1 is an interactive PowerShell menu written by a Microsoft engineer and described in a Microsoft blog post in September 2026. It wraps the site-level reports and trim jobs so you can run them across many sites: audit version policies, generate reports, run a What-If that estimates storage recovered per site, queue the trim jobs and monitor them.
- What it needs: PnP.PowerShell 3.1.0 or later, an Entra ID app registration with delegated SharePoint permissions and admin consent, the SharePoint Administrator role, and site collection admin rights on every site it touches. No extra licence.
- How long it takes: the setup is the work. After that it's menu-driven, but the report and trim jobs underneath still take days.
- What can go wrong: it's sample code on the engineer's own GitHub, provided "AS IS without warranty of any kind", not a Microsoft product. It creates a report library in each site it reports on. The trim jobs it queues are just as permanent. Savings are shown as storage, not money.
6. PnP PowerShell, file by file
Use PnP PowerShell when you want to choose exactly which versions of which files go. It deletes versions directly instead of queuing a trim job.
You need PnP PowerShell with your own Entra ID app registration, and at least Member access to the site. The site's DenyAddAndCustomizePages property needs to be $false; our report script sets it, so set it back afterwards if you don't otherwise allow custom scripts.
Step 1: report on a file and its versions
Get-PnPFileVersion -Url <File URL example: /shared documents/document.docx>

For a report on every file in a library, with one row per version, download Report on File Versions.ps1.

Step 2: trim file versions
Remove-PnPFileVersion -Url <File URL example: /shared documents/document.docx> -Identity <Version ID>
This removes one version. Add -Recycle to send it to the recycle bin instead, where it keeps counting toward storage until the bin is emptied, and -Force to skip the confirmation prompt.
To trim in bulk, review the report CSV, keep only the rows you want deleted and run Bulk trim File Versions.ps1. It deletes those versions permanently, without the recycle bin, and writes a log.

- How long it takes: it's manual for each library: run the report, review the CSV, run the trim.
- What can go wrong: the CSV is hard to review at scale, deletions are permanent, and versions under retention can't be deleted. Test on a small library first.
How long does a version trim job take?
Microsoft doesn't publish a duration: it says a trim job deletes versions "asynchronously in batches in the upcoming days". Plan for days on a large site, not minutes.
How long depends on the number of versions the job has to evaluate, service health and the other jobs running, and trim jobs are subject to off-peak processing. The report job that should come first can also take a few days. You can check progress at any time with Get-SPOSiteFileVersionBatchDeleteJobProgress.
How do you trim SharePoint versions without PowerShell?
Use a tool that runs the trim jobs for you. SProbot is for tenants without a SharePoint Advanced Management or Copilot licence, and for admins who don't want to run and maintain PowerShell. You connect your tenant, SProbot crawls every site, and it calculates what each site would save, in dollars, by trimming versions of active large files.

- Sites are ranked by savings, largest first, so you start where the money is.
- You choose to keep the latest 25, 10 or 5 versions, or only the latest, and run the job across as many sites as you need.
- To be selective, open a site's large files report and trim individual files.
- Jobs run in the background, and every action is recorded in the activity history.
What it saves is your time, not elapsed time. The crawl and the trim jobs still take days to weeks, but your part is about 15 minutes. The same limits apply: trimmed versions are deleted permanently, and SProbot doesn't process trims on versions held by a retention policy or hold. For a fuller comparison with the scripts, see SProbot vs PowerShell scripts. See how SProbot reduces SharePoint storage costs for the savings report and bulk jobs in more detail.
What would trimming save in your tenant?
Connect your tenant and SProbot emails you a savings report based on your own data, and you can run bulk cleanup on 5 sites.
Prefer to see it first? Book a demo to see the reports and cleanup actions on an example tenant.
What to do next
Once versions are under control, the next biggest saving is usually files nobody has touched in years. See Microsoft 365 Archive file-level archiving: costs and limits, or How to free up SharePoint storage: 6 ways to reclaim space for the full list.
FAQs
How do I trim existing SharePoint version history across my whole tenant?
Run New-SPOTenantApplyFileVersionPolicyJob -TrimVersions in the SharePoint Online Management Shell. It applies your tenant-level version policy to every site in one job. It's in public preview and needs a SharePoint Advanced Management or Copilot licence. Without that licence, queue New-SPOSiteFileVersionBatchDeleteJob for each site, or use a tool that does it in bulk.
Does tenant-level SharePoint version trimming need a licence?
Yes. Microsoft requires a SharePoint Advanced Management licence or a Copilot licence for tenant-level trimming and its impact estimate. Site and library trim jobs need no extra licence.
How long does a SharePoint version trim job take?
Microsoft doesn't publish a duration. It says versions are deleted asynchronously in batches over the following days, as background jobs subject to off-peak processing. Plan for days on a large site.
Does changing SharePoint version limits delete existing versions?
Mostly not. An organisation-level change applies only to new libraries. Lowering a library's count limit trims older versions gradually, about 20 each time a file is edited, so files nobody edits keep all their versions. To clear them, run a trim job.
Are trimmed versions sent to the SharePoint recycle bin?
No. Versions deleted by a trim job are permanently deleted and can't be recovered from the recycle bin. SProbot's trimming is permanent too. Only a backup taken beforehand, such as Microsoft 365 Backup, can bring them back.
Can you bulk delete SharePoint version history safely?
Yes, if you first find where version storage sits, agree with site owners how much history to keep, check retention policies and holds, and estimate the impact. Test on one low-risk site before a wider run. Bulk trims are permanent and skip the recycle bin.
Do retention policies block version trimming?
Yes. A trim job doesn't delete versions under a retention policy or eDiscovery hold. It stamps an expiration date on them, and they're deleted only once the retention ends. Microsoft's tenant-level estimate doesn't account for this, so actual savings can be lower.
Can I see how much storage trimming would free before I run it?
Yes. For one site, generate a version usage report and run Microsoft's What-If analysis on the CSV. For the whole tenant, the preview cmdlet Get-SPOTenantApplyFileVersionPolicyJobImpact returns an estimate. Neither shows the saving in money.
Can I trim SharePoint versions without PowerShell?
Not across sites with Microsoft's own tools: every bulk route is PowerShell. SProbot does it without scripts. It shows the savings for each site in dollars and runs the trim jobs in bulk.
Which files should I trim first?
Large files that are edited often, where all versions together take far more space than the latest version. Trimming those frees the most storage for the least risk.















