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"
}
}
}
}
相关文章
- 01-04sharepoint 2013 文档库 资源管理器打开报错 在文件资源管理器中打开此位置时遇到问题,将此网站添加到受信任站点列表,然后重试。
- 01-04SharePoint 2013 Troubleshooting——启用 Developer Dashboard
- 01-04sharepoint 2013文档上传最大50M怎么改啊
- 01-04SharePoint 2013在浏览器中打开pdf文档
- 01-04Sharepoint 2013 启用搜做服务
- 01-04sharepoint读取启用了追加功能的多行文本的历史版本记录
- 01-04SharePoint 2013 用IE11在线打开Word文档报错
- 01-04SharePoint 2013 启用 以其他用户身份登陆(Sign in as different user)
- 01-04每日学习心得:SharePoint 2013 自定义列表项添加Callout菜单项、文档关注、SharePoint服务端对象模型查询
- 01-04SharePoint2013 - 移动文档