0

In SharePoint 2013 on-prem I am using display templates to list out sites. I need to show the sites that have had any kind of updates lately.

I am looking for a property, that is a date and time stamp, which is updated each time anything inside a site changes.

Is there any such magical property?

3
  • LastContentModifiedDate or LastItemModifiedDate? Commented Jan 8, 2016 at 21:43
  • Hi Eric. I could find no such properties. Where do you find them ? Commented Jan 11, 2016 at 15:26
  • 1
    In the search configuration of central administration (in SPO), and I also see them as properties in powershell Commented Jan 11, 2016 at 15:34

1 Answer 1

1

to find the recently visited sites, to find top sites etc. We can find it easily by using site.LastItemModifiedDate.

using (SPSite siteCollection = new SPSite("siteurl")) { SPWebCollection sites = siteCollection.AllWebs; foreach (SPWeb site in sites) { DateTime dt = site.RegionalSettings.TimeZone.UTCToLocalTime(site.LastItemModifiedDate); Console.WriteLine("site::::{0} Modified time::::{1}", site.Title, dt.ToString()); } } 

http://www.mindfiresolutions.com/Find-The-Last-Modified-Date-Of-A-SharePoint-Site-Programmatically-1745.php

or

This PowerShell script is intended to get the "LastModifiedDate" property (amongst others) of all sites in your SharePoint farm.The gathered informations are exported to a csv file, and optionally sent by email with the report as attachment.This script can be useful when auditing SharePoint 2007/2010/2013 Sites: Export the 'Last Modified Date' Property

1
  • Thank you very much Waqas. I was hoping to use display templates and search only, but this is also very handy. Commented Jan 11, 2016 at 16:21

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.