Ir al contenido principal

Entradas

Mostrando entradas de abril, 2015

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 Fuente: http://geekswithblogs.net/bjackett/archive/2013/06/05/powershell-script-to-determine-number-of-files-in-sharepoint-2010.aspx

Powershell : Get count of site collections in Webapplication

  This power shell script will get the count of all site collections in a sharepoint web-application.The same functionality can also be achieved using C#(c sharp) or using the GUI of central administration. But if you need a quick answer power shell is always handy. param($Site,$FilePath) Add -PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue function GenerateAllSitecollectionsCountInWebapplication ($url) { write - host "Extracting the count of site collections in web application....." -foregroundcolor black try { $Site= Get -SPSite $url $spWebApp = $Site.WebApplication write - host Total count in $url is $Site.WebApplication.Sites. Count -foregroundcolor red } catch { write - host "Unable to Extract Sitecollection count .." -foregroundcolor red break } } GenerateAllSitecollectionsCountInWebapplication -Url "www.yoursite.com&q

Check the size of SharePoint 2010 - 2013 sites using PowerShell

  One of those “it may come in useful one day” scripts. It walks through a site hierarchy in SharePoint 2010, reports the size of each one, and then displays a total size for all sites reported. It uses the concepts of the code specified in this article , which calculates the size of a site by adding up the contents of each folder within it. To use, first run the following script: function GetWebSizes ($StartWeb) { $web = Get -SPWeb $StartWeb [long]$total = 0 $total += GetWebSize -Web $web $total += GetSubWebSizes -Web $web $totalInMb = ($total/1024)/1024 $totalInMb = "{0:N2}" -f $totalInMb $totalInGb = (($total/1024)/1024)/1024 $totalInGb = "{0:N2}" -f $totalInGb write - host "Total size of all sites below" $StartWeb " is " $total "Bytes," write - host "which is " $totalInMb "MB or " $totalInGb "GB" $web.Dispose() }   function GetWebSize ($Web) { [