SharePoint lists

How to: get a number of lists and lists items for SharePoint site collection

The fastest way to do it is to use following PS script: Add-PSSnapin Microsoft.Sharepoint.Powershell$ListsInfo = @{}$TotalItems = 0$SiteCollection = Get-SPSite “http://sitecollection.domain.com/”ForEach ($Site in $SiteCollection.AllWebs){ForEach ($List in $Site.Lists){$ListsInfo.Add($Site.Url + ” – ” + $List.Title, $List.ItemCount)$TotalItems += $List.ItemCount}}$ListsInfo.GetEnumerator() | sort name | Format-Table -AutosizeWrite-Host “Total number of Lists: ” $ListsInfo.CountWrite-Host “Total number of ListItems: ” $TotalItems It How to: get a number of lists and lists items for SharePoint site collection