Find Active Inactive Site Collections in SharePoint

Some time back, wrote a PowerShell script to find Most active sites(sub-sites) in SharePoint: Find Most Active SharePoint Sites of a Web Application. Now have a similar requirement, but for SharePoint Site collection! Find Active and Inactive SharePoint site collections of a project collaboration environment.

How to find Most Active SharePoint Site Collections? 

Well, SPSite object has LastContentModifiedDate property, why don’t we use it? Here is the nifty PowerShell script to find the Most active site collections based on content modified date. In a reverse, this can be used to find all In-active site collections also.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
Get-SPWebApplication "" | Get-SPSite -Limit All | foreach {
   Write-Host $_.URL  $_.LastContentModifiedDate

This will reveal SharePoint 2010 inactive sites. For SharePoint 2007, you can slightly change the code.

BTW, I use PowerGUI IDE for writing and debugging PowerShell scripts! as it supports IntelliSense, Debugging and much more.

SharePoint find Most Active Inactive Site collections

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

3 thoughts on “Find Active Inactive Site Collections in SharePoint

  • this is wrong, many things can change that date.

  • Good One Salaudeen!

    I will integrate this to Squadron.


Leave a Reply

Your email address will not be published. Required fields are marked *