Count SharePoint List Items with PowerShell




Today I needed to know a quantity of SharePoint List. Somewhy SharePoint doen't give this information using common tools. But using PowerShell it appeared to do easy.

//add MS SharePoint Snapin for power shell 
if(!(Get-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction:SilentlyContinue)) 
{ 
    Add-PsSnapin Microsoft.SharePoint.PowerShell 
} 

$web = Get-SPWeb http://spdev/SiteWithListUrl/ 
$list = $web.Lists["ListName"] 

$listitems = $list.Items.Count 

Write-Host "Items in list: " $listitems

 




2 Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment





MarkiMarta.com. Notes of web-specialist
Since 2009
18+