Administrator

Get Most Used Document Libraries and Lists in SharePoint

Lately I have been putting a lot of my time into developing useful PowerShell scripts for managing Windows environments. While working on these scripts I’ve developed some really cool 1-liner scripts that are extremely easy to run. In the below 1-liner PowerShell scripts you will get the top 10 most used Document Libraries and Lists by item count. The nice thing about SharePoint and PowerShell is the majority of the scripts written for SharePoint 2010 will work in SharePoint 2013; in this case it does!

Top 10 Document Libraries:

Get-SPSite -Limit All | Get-SPWeb -Limit All | % { $_.Lists} | ? { $_ -is [Microsoft.SharePoint.SPDocumentLibrary] } | Sort-Object { $_.ItemCount } -Descending | Select-Object Title, Description, ItemCount, ParentWebUrl -First 10

 Top 10 Lists:

Get-SPSite -Limit All | Get-SPWeb -Limit All | % { $_.Lists} | ? { $_ -isnot [Microsoft.SharePoint.SPDocumentLibrary] } | Sort-Object { $_.ItemCount } -Descending | Select-Object Title, Description, ItemCount, ParentWebUrl -First 10

PowerShell One Liner for Count of all Documents in SharePoint 2010 Farm

Last week I had a client reach out to me, asking for a count of all documents in their SharePoint 2010 internal farm. They were planning on implementing Metalogix StoragePoint and were working on estimates for the deployment.
After a bit of work with PowerShell, I was able to throw a single line of PowerShell that sum’s the entire environment for me.

Get-SPSite -Limit All | Get-SPWeb -Limit All | % { $_.Lists} | ? { $_ -is [Microsoft.SharePoint.SPDocumentLibrary] } | % { $total+= $_.ItemCount} ; $total