SharePoint Versioning Manager – Control Versioning Settings & Clean Up Old Versions

We have document libraries with unlimited versioning enabled for years. As part of regular auditing Version History Size Report for Entire SharePoint Web Application, found many documents have more than 100 versions!  In order to free up more database storage space and for better performance, We understand that we’ll have to disable or limit versions.

Although, versions are very useful to track changes, each of the versions is a copy of the document and takes up a disk space (Till SharePoint 2010, BTW). As per Microsoft design changing versioning limits will not delete existing minor/major versions of the file until we update it.

It’s a best practice to limit versions. You can Navigate to Document Library Settings >> Version Settings >> and set versioning limits, set versioning ON/OFF in SharePoint versioning settings page. But this will not have any effect on existing documents until you make edits on the document and update them. (You can check out and check in them back as a Shortcut). Also, it’s not possible to get into each document library and set these settings manually, isn’t it? As there were thousands of files in the document library I would like to programmatically approach the change to simply get rid of the old versions across the site and regain space.

PowerShell can Set Versioning Limits and Cleanup Old Versions:

All of these issues can be resolved with a PowerShell script that does clean up old versions in the SharePoint library by looping through all the site collections, webs, lists, and items. From each item, it checks the versions and deletes them. Take a look at my post: Limit and Cleanup Versioning in SharePoint with PowerShell

SharePoint SharePoint doesn’t enable versioning by default!

However, not all SharePoint guys are good at PowerShell scripting (You must be good at PowerShell, SharePoint Admins!), and obviously, it’s easy to make a disaster if you are a novice! So, would like to have a GUI-based SharePoint utility to fix the versioning of document libraries.

SharePoint Versioning Manager Utility to Set Limits and Cleanup Old Versions
I’ve created a SharePoint tool using C# object model, which gives the functionality to manage document versions and  programmatically remove extraneous versions either for a selected list or library or of all lists and libraries in a SharePoint site. It takes parameters such as:

  • Site collection URL, Site
  • List/Library (or All List & Libraries)
  • Define Version limits (No. of major versions / No. of minor versions to keep)
  • Turn OFF/Turn ON versioning for selected or all lists/libraries.

and perform desired operations. Here are some screen shots of SharePoint Versioning Manager in action.

This utility is built on SharePoint server object model and must be running from SharePoint Web Front End Servers! Not from your desktop!!

Get Versioning Analysis of all document libraries and lists:
Tool to Analyze sharepoint versioning Settings
Analyze Versioning of a Selected Library:Reduce sharepoint versioning to get storage space
Set Versioning Limit and Cleanup for a Selected Library:
SharePoint Versioning Manager - Control and Clean Up Old Versions

Set the versioning limits either for the selected list/library or for the entire site.
Tool to Trim and Cleanup SharePoint Versions
In a Project collaboration environment, with this utility, We had a doc library setup with versioning 5 major and 5 minor. We recovered about 28 GB of free space!

As always, I see there are room for enhancements to the tool, will update and release a new version as and when time allows!

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

19 thoughts on “SharePoint Versioning Manager – Control Versioning Settings & Clean Up Old Versions

  • I have SharePoint Online but the GUI only lets me change the versioning to a minimum of 100. I want to set it at 50. Is my only alternative to use Powershell? Do you have a link to a script that outputs all of the lists from a particular site and can change the versions, if needed? I’d rather do it site-by-site than a shotgun approach to every site. Thanks in advance for your help. The GUI is fantastic but it doesn’t work with O365. 🙁

  • Will this work for SharePoint Online?

    • No! This is written for SharePoint On-Premises. For SharePoint Online, PowerShell scripts on this site can help.

  • Hello,

    I run the utility from my SharePoint 2016 Front end server. (run as administrator) . I enter mu Site collection URL and click Load site. I wait a 45-60 seconds than I receive the error message : Please Provide a Valid Site Collection URL.. I try with those forms…https://…https://servername …https://localhost/default.aspx …Also with the IP of the server…No luck still the same error message.
    Could you help me to get it working ?

    My server is a W2K12 English version. SharePoint have the English version BUT I have installed the French version package for my collection site.. Could this explain my issue ?

    • Try to Browse the Site URLs you input to the tool from the server. Other chances are you may have to disable Loopbackcheck!

  • Downloaded SharePoint 2013 version. but i get “Could not load file or assembly: Microsoft.Sharepoint, version: ” error..
    any idea?

    • Looks you are trying to run 2010 version! Make sure you are running the right version from SharePoint Server!

  • Please can it work for 2019. If yes, where is the utility placed on the WFE server

  • Any plans to update this tool for 2016

  • Thanks a lot for this tool 🙂 great work

  • Demo-ing now and this tool is working great! Much appreciated

  • Need SP 2013 Version. Can you assist?

  • Will this work with SharePoint 2013?

  • Saludeen –

    Is there a way to run this utility on an automated, command-line basis? I have a long list of sites that I need to run analysis reports on. Your initial code is great, but I’d hate to re-invent the wheel and write a new utility to export CSVs/Excel Spreadhseets when yours already does that.

    Thank you,

    • Larry,

      This utility written in .Net WinForms! If you are looking for automation: PowerShell scripts on this blog can help.

  • Hi Salaudeen, Thanks for this.
    I had several lists with problems around the enormous amount of versions (someone created a workflow that looped, which on a list with unlimited versioning… well ) I could not even delete the list because the server ran out of resources.

    Your tool helped me a lot to clean this mess up, many thanks for that!


Leave a Reply

Your email address will not be published. Required fields are marked *