PowerShell script/code to get SharePoint List Item count
The same script works for both lists and libraries. You can add filters to get only specific items.It is recommened to use variables so you can quickly modify the values and reuse script for any other site, list, library.
$siteUrl = "http://siteurl"
$listName = "[Name of List/Library]"
$spWeb = Get-SPWeb $siteUrl
$spList= $spWeb.Lists[$listName]
$items = $spList.Items.Count
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!