maandag 28 januari 2013

Get all version enabled lists







To search on all site collections manually to version enabled lists takes a lot of time.

So because of that i wrote a ps script.

Function GetAllVersionEnabledLists($LogFile, $SiteUrl)
{

if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
Add-PSSnapin Microsoft.SharePoint.PowerShell;
}

Start-Transcript -Path $LogFile

$sitecollection = SPSite($SiteUrl)
foreach ($web in $sitecollection.AllWebs)
{
foreach($list in $web.lists)
{
if ($list.EnableVersioning -eq $true)
{
Write-Host ($site.Url +"-" +  $web.Title +"-"+ $list.Title + "->" + $list.EnableVersioning)
}
}
}

Stop-Transcript
}


Example : GetAllVersionEnabledLists c:\temp\log.log http://url 

Geen opmerkingen: