I did the thing (Sharepoint Versioning Cleanup)

Posted by PorreKaj@reddit | sysadmin | View on Reddit | 53 comments

We've been hitting the storage limit a few times, forcing us to purchase 11TB of extra storage for SharePoint, with no end to it.
SharePoint previously had no clear ownership in our organization. It recently became mine, and inspired by that guy, I went a head and spent several days running scripts to set Automatic Versioning, and ordering the batch delete job.

Fun facts:

Set-SPOSite -Identity $siteUrl -EnableAutoExpirationVersionTrim $true -confirm:$false
New-SPOSiteFileVersionBatchDeleteJob -Identity $siteUrl -Automatic -confirm:$false

Takes about 3-4 seconds to run per site, meaning I could get to around 6-8000 sites during one activation of my sharepoint admin role (of 33.000 sites).

In the end we managed to reduce our storage consumption beyond our wildest dreams, from 98.1% capacity to 50,3% - or 54TB storage released!

Don't be like that guy, consider your file version policies!
Next on the agenda: the fact that only 4% of our sites are considered 'active'