SharePoint Online storage management: reducing version bloat and duplicate content

2026-02-09 17:29:33
Posted by Steve Soper on Feb 9, 2026 9:29:33 AM

SharePoint Online is built for collaboration, but storage growth is rarely set it and forget it. In most tenants, the storage curve is driven by everyday activity like co-authoring, AutoSave, and long-running project sites that never quite get cleaned up. Microsoft’s guidance is to treat storage as an operational concern: monitor trends, configure version history and retention intentionally, and take action on low-value content before it becomes a cost problem.

In this post, we will cover the most common storage drivers we see in the field (version history and file duplication), along with a practical, low-risk approach to reduce storage use without disrupting end users. We will also give a high-level overview of an AdaptivEdge PowerShell script that enables automatic version trimming and performs a one-time cleanup of older file versions.

 

Why storage grows faster than expected

  1. Version history sprawl

Version history is a core SharePoint feature, and it is essential for recovery and collaboration. The challenge is that modern editing behaviors (co-authoring and frequent saves) can create a large number of versions over time, especially for active files. The out-of-box version limits many libraries inherit can also contribute to growth.

  1. Duplicate files, duplicate storage

File duplication usually shows up in a few patterns: multiple copies created via Save As, parallel drafts stored in different folders, or content duplicated across sites during reorganizations and migrations. Each copy becomes its own lifecycle, with its own version history, retention outcomes, and long-term storage impact.

  1. Governance gaps that compound over time

If site ownership, content lifecycle, and library design are unclear, storage optimization becomes reactive. This is one reason many SharePoint experts push information architecture first (sites and libraries that reflect business boundaries, plus clear ownership) as a foundational best practice.

 

Common SharePoint Storage Challenges

Even with version trimming and duplicate cleanup in place, several hidden or systemic factors can continue driving storage growth. Here are three of the most common challenges:

Microsoft 365 Archive offers a lower-cost storage tier for inactive SharePoint sites. It is ideal for content that must be retained for compliance but is rarely accessed. However, it only supports full-site archiving (not individual files), and retrieval times may be slower. Organizations often overlook this option until storage costs spike.

Preservation hold libraries are hidden containers created by compliance policies. They retain original versions of files, even after deletion or modification, making them essential for legal holds but problematic for storage optimization. These libraries are not affected by version trimming and can silently accumulate large amounts of data.

Inactive sites, abandoned project spaces, and old team workspaces can consume significant storage. SharePoint Advanced Management allows administrators to configure policies that detect inactivity, notify site owners, and trigger archiving or deletion workflows. Without these policies, inactive sites often persist indefinitely.

Reducing storage footprint is a smart financial move, but it comes with tradeoffs. Aggressive version trimming or deletion may limit your ability to restore files from far-back edits or recover deleted content. The key is aligning version retention depth with business needs—keeping deep history where it matters and trimming aggressively in high-churn libraries.

Priority Scenario

Recommended Strategy

Need instant access and collaboration

Standard Storage

Need to retain content affordably

Microsoft 365 Archive

Need to clean up abandoned content

Inactive Site Policies

Need to reduce costs without losing control

Inactive Site Policies

Need to preserve content for compliance

Microsoft 365 Archive

 

Understanding SharePoint Storage Costs

Before implementing cleanup strategies, it is important to understand how SharePoint storage is allocated and priced:

Each Microsoft 365 tenant receives 1 TB of SharePoint storage, plus 10 GB per licensed user.

Additional storage costs $0.20 per GB per month.

Microsoft 365 Archive offers cold storage at approximately $0.05 per GB, ideal for rarely accessed content.

Deleted items in the recycle bin still count toward your quota until permanently removed.

Most organizations can reduce storage costs by 40 to 60 percent through cleanup, archiving, and governance.

 

 

 

Microsoft-recommended best practices for SharePoint storage

Below are the storage management moves Microsoft highlights consistently, plus how we typically apply them during engagements:

  1. Monitor storage trends and identify what is driving growth. Use admin center reporting to understand which sites are growing and why, then prioritize cleanup where it matters most.
  2. Set version history limits and review retention policies. Configure version history limits and align retention policies with business and compliance needs.
  3. Trim low-value versions to reclaim space. Trimming existing low-value versions can reduce storage footprint, especially in high-churn libraries.
  4. Archive inactive content rather than keeping everything hot. For content that must be retained but is rarely accessed, consider archive approaches to reduce active storage costs.
  5. Design sites and libraries to avoid one giant repository. Structuring content into multiple sites and libraries affects your ability to govern versioning, retention, and ownership at a reasonable scope.

 

High-level overview: what the AdaptivEdge version cleanup script does

The attached script is designed to do two things across SharePoint Online document libraries:

  • Enable ongoing automatic version trimming
  • Perform a one-time cleanup that keeps only the most recent N versions per file

**CRITICAL: Version Trimming is Permanent and Irreversible**

Versions deleted by this script are permanently deleted and bypass the recycle bin. Deleted versions cannot be recovered through normal recovery workflows. Microsoft strongly recommends:

  • Running impact analysis (Dry Run mode) before committing to deletions
  • Verifying versions to be deleted don't conflict with retention requirements
  • Ensuring stakeholders understand the recoverability implications

The following is the non-technical breakdown.

 

Step 1: Connects to SharePoint securely

The script supports two authentication approaches using PnP PowerShell:

  • Delegated (interactive) sign-in, useful for an admin running it manually from an Entra-joined machine
  • App-only certificate authentication, useful for controlled automation

It intentionally avoids client secrets and uses certificate-based options when running app-only.

 

Step 2: Chooses which sites to process

You can run it in two modes:

  • Tenant-wide, targeting sites created on or before a cutoff date
  • Single site, targeting one site URL for a controlled run

This makes it easier to phase cleanup, start with a pilot, or focus on known storage hotspots.

 

Step 3: Ensures access so cleanup does not fail mid-run

Version cleanup can fail if the executing identity does not have sufficient rights across every site and library. The script addresses this by temporarily ensuring site collection admin access on the target sites. It can also remove that elevated access after completion if you enable the cleanup option.

 

Step 4: Turns on automatic version trimming at the library level

For each non-system document library within the target sites, the script enables Automatic mode using Set-PnPList -EnableAutoExpirationVersionTrim. This applies Microsoft's intelligent version trimming algorithm to each library individually, allowing ongoing automatic cleanup going forward.

 

Step 5: Performs a one-time pruning of older versions

After enabling automatic trimming, it does a one-time pass through each file in each library and removes versions older than your configured threshold (for example, keep the latest 10 or 50 versions). It supports a Dry Run mode so you can estimate impact without making changes.

 

Step 6: Produces logs and (optionally) a summary report

The script writes to a CSV log file and can also generate an aggregated summary report showing how many files were processed and how many versions were deleted. This is helpful for change records and for communicating outcomes to stakeholders.

 

How we recommend using this approach

If you are planning version cleanup at scale, a safe rollout usually looks like this:

  1. Start with reporting. Identify the top sites and libraries by storage and activity
  2. Run a pilot in Dry Run mode on a single site. Validate scope, timing, and expected reductions.
  3. Align version retention with business reality. Not every library needs the same depth of recoverability.
  4. Enable automatic trimming broadly, then prune selectively. Automatic trimming keeps future growth under control, and pruning reduces existing bloat.
  5. Revisit duplicate content drivers. Cleanup works best when paired with user guidance on collaboration patterns and document ownership.

 

Closing

Version history is valuable, and it is also one of the most common reasons SharePoint Online storage grows faster than expected. Microsoft’s guidance is clear: set sensible limits, review retention policies, monitor trends, and reduce low-value content where possible.

The AdaptivEdge script enables automatic trimming to prevent future sprawl, and it provides a controlled way to clean up existing versions at scale, with Dry Run support and audit-friendly reporting.

Note: The script includes an AS IS disclaimer and is intended to be validated in a test or pilot scope before broad rollout.

 

Sources

Plan for SharePoint storage (Microsoft Learn): https://learn.microsoft.com/en-us/sharepoint/sharepoint-storage-planning

October 2025 Microsoft 365 Announcement Highlights (AdaptivEdge): https://info.adaptivedge.com/blog/october-2025-microsoft-365-announcement-highlights

 

Technical Details: Version History Cleanup Script

This PowerShell script, Pnp-VersionHistoryPurge_SetAutomaticTrim.ps1, enables automatic version trimming on SharePoint Online document libraries and performs a one-time prune to retain only the most recent N versions. It supports both Delegated (interactive) and AppOnly (certificate-based) authentication modes using PnP.PowerShell. The script can target all sites created before a cutoff date or a single specified site, and includes detailed logging, summary reporting, and optional cleanup of elevated admin access.

  • Supports Delegated and AppOnly authentication via PnP.PowerShell
  • Enables automatic version trimming using Set-PnPList -EnableAutoExpirationVersionTrim
  • Performs one-time cleanup using Get-PnPFileVersion and Remove-PnPFileVersion
  • Logs errors and actions to C:\Temp\ErrorLog_<MM-dd-yyyy>.csv
  • Generates summary report to C:\Temp\VersionTrimSummary_<yyyyMMdd_HHmmss>.csv
  • Supports DryRun mode for safe testing
  • Can remove Site Collection Admin access after execution with -CleanupAdminAccess

Example Usage

Example 1: Delegated auth, dry run across all sites before 2025-08-26

.\Pnp-VersionHistoryPurge_SetAutomaticTrim.ps1 -TenantName "contoso" -ClientId "<GUID>" -CutoffDate '2025-08-26' -KeepLatestVersions 10 -DryRun -GenerateSummary

Example 2: AppOnly auth with certificate thumbprint for a single site

.\Pnp-VersionHistoryPurge_SetAutomaticTrim.ps1 -TenantName "contoso" -ClientId "<GUID>" -AuthMode AppOnly -CertificateThumbprint "<THUMBPRINT>" -SingleSiteUrl "https://contoso.sharepoint.com/sites/Finance" -KeepLatestVersions 10 -DetailedLog -GenerateSummary

 

Tags: Collaboration, PowerShell, SharePoint, Governance, Storage, Labels, Classification, Compliance

    Are You Secure? Score a FREE O365 Security Assessment.

    We're here to help!

    We'd love to find out more about the projects and initiatives you're working on to exchange ideas and provide some high-level guidance where we can.  We love learning from others as well as sharing some of our experience and lessons learned.  Let's talk!

    Subscribe to Email Updates

    Recent Posts

    Posts by Tag

    see all