Often it’s a requirement to have Versioning turned on in a SharePoint List or Library. Versioning is a list/library level attribute and there’s unfortunately no way via the Site Settings GUI to tell SharePoint at the Site Collection or Site level to always have versioning turned on when a new list or library is created..

Traditionally, If you want versioning to be turned on in each new list/library, you’d have to either:

  • Use your own library template (with versioning turned on)
  • Use feature + event handler to programmatically activate versioning on each new list

The easiest way out of those two options is probably to use your own template. To do this, create a new document library, activate versioning, then save this list as template.

When you create a new list, you will then be able to use your template and directly create a list with versioning activated.

What about cases where we don’t want to/can’t use templates and we have admins spinning up new lists/libraries and jonesing for that versioning goodness?
The following PowerShell can be used to report on, and optionally enable Versioning on all Lists and Libraries in the site collection URL it is fed.
Minor Versioning, and Major/Minor Version quantity limit toggling is also in there but commented out. To turn on those options, simply remove the # symbol from the beginning of the lines.

PowerShell Script (save as file e.g. Enable-Versioning.ps1):

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$siteURL = $args[0]
$execute = $args[1]
$site = Get-SPSite($siteURL)
foreach($web in $site.AllWebs) {
Write-Host "Inspecting " $web.Title
foreach ($list in $web.Lists) {
Write-Host "Versioning enabled: " $list.EnableVersioning
$host.UI.WriteLine()
Write-Host "MinorVersioning Enabled: " $list.EnableMinorVersions
$host.UI.WriteLine()
Write-Host "EnableModeration: " $list.EnableModeration
$host.UI.WriteLine()
Write-Host "Major Versions: " $list.MajorVersionLimit
$host.UI.WriteLine()
Write-Host "Minor Versions: " $list.MajorWithMinorVersionsLimit
$host.UI.WriteLine()
if($execute -eq "execute") {
$list.EnableVersioning = $true
#if($list.BaseType -eq "DocumentLibrary") {
#$list.EnableMinorVersions = $true
#}
#$list.MajorVersionLimit = 3
#$list.MajorWithMinorVersionsLimit = 3
$list.Update()
Write-Host $list.Title " is updated"
}
}
}

Usage:
Script takes two parameters:
1. Required: Site collection URL e.g. http://mysitecollection Specifies the site collection to operate on.
2. Optional: execute Script runs in report mode only unless you add the word execute
Example 1: Run the script in report mode only (no changes effected):
    c:usersadministratordesktop.Enable-Versioning.ps1 http://mysitecollection
Example 2: Run the script in execute mode:  c:usersadministratordesktop.Enable-Versioning.ps1 http://mysitecollection execute

This script could potentially be run on an automated basis via the Windows Task Scheduler – this would let you run it on a regular basis to ensure all lists/libraries in a site collection have Versioning turned on.