Change SharePoint Default Versioning

For SharePoint Online administrators managing large environments, keeping track of storage usage is crucial to maintaining performance and controlling costs. One key factor contributing to storage consumption is document versioning. By default, SharePoint Online keeps up to 500 major versions of each document, and with frequent updates, this can quickly add up.

 

Squirrel Main Dashboard

In this guide, we will explain why it’s essential to limit document versioning across your entire SharePoint Online environment and provide a step-by-step walkthrough on how to apply these limits using SharePoint Online Management Shell or PowerShell. This will help you ensure optimal performance and reduce storage costs across all your sites.

Why Limit Document Versioning Across the Entire Environment?

As a SharePoint Administrator, managing document versioning across the entire environment provides several benefits:

Reducing Storage Costs

  • Storage Allocation: SharePoint Online comes with limited storage based on your Microsoft 365 subscription. Versions of documents count towards your storage quota, so limiting them can help avoid additional storage purchases.
  • Cost Efficiency: By controlling the number of versions stored, you reduce the need for extra storage, keeping costs manageable.

Consistent Governance

  • Version Limits Across Sites: Applying a standard versioning limit across all sites ensures a consistent governance approach to data management.
  • Compliance: Certain regulations and organizational policies may require limiting the number of versions stored to comply with retention policies.

Simplifying Document Management

  • Fewer Versions to Manage: Limiting versions makes document management easier for users and admins, ensuring that only relevant changes are kept.
  • Performance Improvement: Fewer versions per document reduce the load on document libraries, improving performance and retrieval speeds.

Default Versioning Settings in SharePoint Online

By default, SharePoint Online automatically enables versioning in every document library, with the system set to retain up to 500 major versions of each document. Each time a document is edited and saved, SharePoint creates a new major version, and these versions are stored indefinitely unless a limit is manually set.

While this can be extremely helpful for tracking changes, restoring older versions, and collaborating on documents, it can also lead to rapid storage consumption, especially in environments with many active users, frequent edits, or large file sizes. In organizations with hundreds or thousands of users, the storage of 500 versions per document across multiple sites and libraries can quickly add up, causing storage to balloon unexpectedly.

Without intervention, this default setting can exhaust your SharePoint Online storage allocation, forcing organizations to purchase additional storage from Microsoft at a premium. For businesses focused on cost-efficiency, managing versioning settings is a critical task to ensure that storage usage remains under control while still maintaining an appropriate version history for documents.

How to Limit Versioning for All Sites in SharePoint Online

As an admin, you can set versioning limits across your SharePoint Online tenant using PowerShell. This will apply the changes globally to all existing document libraries, ensuring consistency and helping reduce storage costs.

Prerequisites

  • Permissions: You must be a SharePoint Online Admin or Global Admin to make changes across your environment.
  • Tools Needed: You’ll need to have SharePoint Online Management Shell or PowerShell installed.

Step-by-Step Guide to reduce SharePoint Online Document Versions

Step 1: Install and Connect to SharePoint Online PowerShell

  1. Open PowerShell on your machine.
  2. Install the SharePoint Online Management Shell (if you haven’t already):
    powershell

    Install-Module -Name Microsoft.Online.SharePoint.PowerShell

     

  3. Connect to SharePoint Online:
    powershell

    Connect-SPOService -Url https://<your-domain>-admin.sharepoint.com

     

    Replace <your-domain> with your actual domain.

Step 2: Get All Sites in Your Tenant

To make changes across all document libraries in SharePoint Online, first retrieve a list of all site collections in your tenant:

$sites = Get-SPOSite -Limit All

 

Step 3: Iterate Through Each Site and Set Versioning Limits

You can loop through each site and set versioning limits for each document library. In this example, we’ll limit the number of major versions to 10 across all document libraries.

foreach ($site in $sites) {

# Get all document libraries in the site

$libraries = Get-PnPList -Web $site.Url | Where-Object {$_.BaseTemplate -eq 101}

foreach ($library in $libraries) {

# Set the version limit to 10 major versions

Set-PnPList -Identity $library -MajorVersions 10

Write-Host “Versioning set to 10 for library $($library.Title) in site $($site.Url)”

}

}

 

  • Explanation: The script loops through each site, retrieves the document libraries, and sets the number of major versions to 10.
  • 101: This refers to document libraries specifically.

Step 4: Run the Script

Once your script is ready, run it in PowerShell. The script will apply the new versioning settings to all document libraries across your SharePoint Online environment.

Step 5: Verify the Changes

You can verify that the versioning settings were applied by visiting any document library and checking the versioning settings:

  1. Go to any site collection in SharePoint.
  2. Navigate to Site Contents > Library Settings > Versioning Settings.
  3. Ensure that the version limit is set to 10.

Alternative Solution:

 

Use Squirrel for Archiving Documents and Versions

 

Another alternative for managing document versions across a SharePoint Online environment is to use Squirrel, a document archiving solution that moves documents (along with their versions) to more cost-effective Azure Blob Storage. Squirrel retains the full version history and metadata without consuming SharePoint storage, reducing both costs and complexity.

 

With Squirrel, you don’t need to worry about storage limitations in SharePoint Online. The system allows users to rehydrate files on demand, making document restoration easy while keeping all versions intact. This provides a scalable solution for organizations with extensive document histories that need to maintain large archives efficiently.

 


 

Conclusion

 

For SharePoint Online administrators, managing versioning limits across the entire environment is critical to controlling storage costs, improving performance, and ensuring governance consistency. By using SharePoint Online Management Shell or PowerShell, you can efficiently apply versioning limits to all sites and document libraries.

 

Alternatively, solutions like Squirrel can help you archive documents and their versions outside of SharePoint, providing cost-effective, long-term storage while keeping all version histories intact.

 


 

Additional Resources

 

 

Reducing SharePoint Storage Costs Doesnt Have to be Hard

Reducing SharePoint storage costs is easy with Squirrel, which seamlessly archives documents and versions to cost-effective Azure storage.

Squirrel for SharePoint File Type Reporting

Save on SharePoint storage costs with Squirrel, the seamless solution for archiving documents and retaining version history in Azure.

Want to Reduce SharePoint Costs?