Enable versions in SharePoint Library using PowerShell

$site = get-spsite("SiteURL")
foreach($web in $site.AllWebs) {
 Write-Host "Inspecting " $web.Title
 foreach ($list in $web.Lists) {
 if($list.BaseType -eq "DocumentLibrary") {
 $list.EnableVersioning = $true
 $list.MajorVersionLimit = 5
 $list.Update()
 }
 }
}

Comments

Popular posts from this blog

This content database has a schema version which is not supported in this farm

Export all documents/Folders permissions to CSV using SharePoint PowerShell

SPUtility.js