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

IRM and the Object Model

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

Activate and Deactivate Feature through PowerShell