Identify activity date in SharePoint 2013

 
SharePoint is a collaborative platform and installations tend to grow out rapidly due to the nature of user involvement.
To maintain the integrity of the platform, it's important to track the active usage of sites once created that may or may not be used over a period of time.
 
In the course of SharePoint maintenance, it may be needed to find the most/least active sites or determine sites not being used since a set amount of time. You can use the following properties from the SharePoint API to determine the date of the last change. This information can be used to maintain the sites or alert/contact the sites owners/users. eg. notify the site owners when a site has not been updated since the past 6 months.
  1. Identify Activity on SharePoint Site Collection
    SPSite.LastContentModifiedDate
  2. Identify Activity on SharePoint Sites - interesting that this is a read-write property - you can update the last modified date on the Site through code!
    SPWeb.LastItemModifiedDate
  3. Identify Activity on SharePoint List(s)
    SPList.LastItemModifiedDate
  4. Identify the last date when security on a site was changed
    SPSite. LastSecurityModifiedDate
 A quick powershell script could be setup to enumerate through the sites within a site collection and provide a list of site update dates.
 
It's important to note that several factors could contribute to a change in the "last updated dates" and it's important to heed what can cause the date to be changed. eg. auditing may cause the last updated date to change on an item just being viewed.
 
Also note that the times are returned in UTC time. You can use RegionalSettings.TimeZone.UTCToLocalTime() to convert to the local timezone for the user or for the site.
 
Happy Coding!
Ebook Download
View all
Learn
View all