PowerShell -- Script para determinar el número de archivos en SharePoint 2010 o 2013 “bibliotecas de documentos”
Start-SPAssignment -Global
$OutputFile = "L:\SharePoint\DocCount.csv"
$results = @()
$webApps = Get-SPWebApplication
foreach($webApp in $webApps)
{
foreach($siteColl in $webApp.Sites)
{
foreach($web in $siteColl.AllWebs)
{
$webUrl = $web.url
$docLibs = $web.Lists | Where-Object {$_.baseType -eq "DocumentLibrary"}
$docLibs | Add-Member -MemberType ScriptProperty -Name WebUrl -Value {$webUrl}
$results += ($docLibs | Select-Object -Property WebUrl, Title, ItemCount)
}
}
}
$results | Export-Csv -Path $OutputFile -NoTypeInformation
Stop-SPAssignment -Global
Comentarios