Ads

Tuesday, 7 March 2017

C# code to get Last Modified Date of a SharePoint Site/web Programmatically

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());

  }
}




No comments:

Post a Comment

Ads