Hi Leif,
I use a PowerShell script which runs as a scheduled task to send me a list of my top 50 largest lists. If you to purge items or send them to an archive you should be able to do that with some modification. Here is a script that you can use to create a document and store it locally. If you need to run it on demand just to check periodically then you can change the add-content line to a write-host command. Also notice that I've hard coded '2000' as a minimum to record so you might wanna change that in your environment. If you need a more robust feature checkout HarePoint.com. They've got a workflow monitor that I'm testing out now on our QA environment.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#For Output file generation
$OutputFN = "e:PowershellscheduledLargeListsData.csv"
#delete the file, If already exist!
if (Test-Path $OutputFN)
{ Remove-Item $OutputFN}
#Write the CSV Headers
Add-Content $OutputFN "List Name , site Collection , Site URL , Item count"
#Get the Web Application URL
$WebAppURL = "<your web app here>"
$SPwebApp = Get-SPWebApplication $WebAppURL
#Loop through All Site collections, Sites, Lists
foreach($SPsite in $SPwebApp.Sites)
{ foreach($SPweb in $SPSite.AllWebs)
{
foreach($SPlist in $SPweb.Lists)
{
if($splist.ItemCount -gt 2000)
{
$content = $SPlist.Title + "," + $SPsite.Rootweb.Title +"," + $SPweb.URL + "," + $SPlist.ItemCount
add-content $OutputFN $content
}
}
$SPweb.Dispose()
}
$SPsite.Dispose()
}
Hi Richard,
Thanks for the input - I can definitely use this script!
Regards
Leif
If you use Sharegate for monitoring and migrations, there is a report in it that can tell you this information.
But I'm all for PowerShell! PowerShell is your friend. It's like a force power.
Hi Andrew,
I finally got my hands on Sharegate. It's a great product - even though Powershell holds the true power :-)
Regards
Leif