Until 2024 SharePoint had one knob: keep the newest N versions. Now there are two. They sound interchangeable and are not.
Hard limit: keep the newest N
Set per library (or per site/tenant as a default). SharePoint keeps the newest N major versions of each file and drops the oldest on every save. The UI floor is 100; PowerShell goes lower (how).
- Keeps: the last N saves, regardless of when they happened. A file autosaved 200 times on Tuesday and never since keeps Tuesday's last 100 saves and nothing from before.
- Reclaims: predictable amounts; a 500 → 100 change reclaims up to 80% of a heavily-edited file's versions.
- Good for: compliance libraries where "we retain the last 20 versions" is a written policy; anywhere you must state a maximum.
- Weakness: counts saves, not time. Autosave makes N versions a few hours of history for an active file and years for a dormant one.
Automatic (intelligent) versioning
Set per tenant, site or library. SharePoint keeps every version from the last 30 days, then thins by age: one per day for a period, then one per week, then one per month, up to the library's overall limit.
- Keeps: recent history in full, old history sparsely. You can always go back to "yesterday 14:32"; you can go back to "roughly the first week of March".
- Reclaims: Microsoft quotes up to 96% on older versions. In practice it removes almost all autosave noise from the past and keeps the meaningful checkpoints.
- Good for: the tenant default. It matches how people actually use history ("undo this week's mistake"; "what did it look like last quarter").
- Weakness: you cannot promise an auditor a fixed count, and it will not thin versions that are all inside 30 days.
What each one deletes from an existing library
Neither setting touches existing versions until the file is saved again, or until you run a trim job. That is where the comparison gets concrete. Suppose a 40 MB report has 480 versions over 14 months:
| Setting | Versions kept | Space kept |
|---|---|---|
| Hard limit 100 | newest 100 (probably the last few weeks) | ~4 GB |
| Hard limit 5 | newest 5 | ~200 MB |
| Automatic | last 30 days in full, then daily → weekly → monthly (~60–90) | ~2.5–3.5 GB |
Automatic keeps more than a limit of 5 and less than 100 in this case, but distributes what it keeps across the whole 14 months instead of stacking it at the end.
Applying either one to what already exists
Connect-SPOService -Url https://contoso-admin.sharepoint.com
# Tenant default for new libraries: automatic
Set-SPOTenant -EnableVersionExpirationSetting $true -EnableAutoExpirationVersionTrim $true
# Apply to an existing site (new files) ...
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/Finance -EnableAutoExpirationVersionTrim $true
# ... and trim what is already there, after the report
New-SPOSiteFileVersionExpirationReportJob -Identity https://contoso.sharepoint.com/sites/Finance -ReportUrl 'https://contoso.sharepoint.com/sites/Finance/Shared Documents/report.csv'
New-SPOSiteFileVersionBatchDeleteJob -Identity https://contoso.sharepoint.com/sites/Finance -Automatic
Swap -Automatic for -MajorVersionLimit 20 -MajorWithMinorVersionsLimit 0 for a hard-limit trim. Both are permanent.
A sensible policy
- Tenant default: automatic. Safe to switch on without per-library analysis.
- Compliance libraries: hard limit set to the number in the policy document, via PowerShell if it is below 100.
- Before any trim of existing versions: a what-if. The expiration report CSV, or a tool that shows per-library what a policy would delete and in GB. TrimVersions365's What-if tab is that, and its execute step never touches the current version or the file itself.