Forum Discussion
Trimming SharePoint Version History - Minor Versions
Hello,
I am a SharePoint Admin at my organization and I have been asked to reduce our total storage usage by reducing the number of versions and minor versions in our environment on all SharePoint sites.
I have written a simple PowerShell script that loops through a csv file with site addresses, and runs this command per site ->
New-SPOSiteFileVersionBatchDeleteJob -Identity $site.siteURL -MajorVersionLimit 100 -MajorWithMinorVersionsLimit 5
It was my understanding that for all sites in the csv file, for all document libraries on the site, and for all files in the libraries this command will reduce the file to the last 100 Major versions, and the last 5 minor versions of each major version.
Unfortunately, this command is not actually reducing the minor versions. It is working with the Major versions just fine, but all minor versions are being retained for each major version retained.
Is my understanding of this command wrong, or is it not working? Are there other factors to consider? Does anyone know of an alternative that can fit my needs?
The overall plan is to trim the current version history, then apply the automatic version setting to each library in our tenant.
Here is the MS guide I referenced, maybe I missed something -> https://learn.microsoft.com/en-us/sharepoint/tutorial-queue-a-trim-job
Any help is greatly appreciated,
Cam