启用SharePoint 2013文档版本控制

cls
$PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null
$webAppUrl = Read-Host
$WebApp = Get-SPWebApplication $webAppUrl
Foreach ($SiteColl in $WebApp.Sites)
{
    $rootSite = Get-SPSite $SiteColl.Url
    $allWebs = $rootSite.AllWebs
    foreach ($web in $allWebs)
    {
        $lists = $web.lists
        foreach ($list in $lists)
        {
#            $list.EnableVersioning = $false
#             $list.update()
            if($list.EnableMinorVersions -eq $false)
            {               
                # write-host $list.title "is a not using versions"
                 if($list.BaseType -eq "DocumentLibrary")
                 {
                     write-host $list.title "is a not using versions"
                     $list.EnableMinorVersions = $true
                     $list.update()
                 }
            }
            else
            {
                 $list.EnableMinorVersions = $false
                     $list.update()
                 #Write-host $list.title " is set for up to " $list.MajorVersionLimit "previous versions"
            }
        }
    }
}

上一篇:关于jsb中js与c++的相互调用


下一篇:2018超详细sublime text3+python3.x安装配置教程(附常用插件安装教程)