2

I want to find the sitecollection created and last content modified date in Sharepoint 2010, found a SPSite property for last content modified date however could not find any clue to find the created date. Is there a way to find the sitecollection created date?

2

This post for Sharepoint 2003 mentions it would be site.RootWeb.Created. This post echoes that as well. I would have figured it would be available as part of the SiteData web service.

The SiteData web service shows it as part of the WebMetaData. If you wanted strictly content only, I think you'd have to look at all the lists and libraries in the site and get the data on a per list/library level and get the most recent modification.

2

As Eric mentioned, it is exposed through the SiteData web service. I wanted to test it before I posted; note though that I believe you might have to be an administrator to execute the SiteData web service (that'd need another test to verify; I can't remember 100% either way).

SiteData Web Service

1

For MOSS2007, we ended up using the created date of the Site Template Gallery because the created of the SPSite could potentially change (it was years ago, but I think restoring a site from backup would do it). As we're upgrading to SP2010, we are using the Solution Gallery, since the Site Template Gallery is gone. The code (minus all the error handling) looks like this:

   site.RootWeb.Lists["Site Template Gallery"].Created

Also, be careful about last content modified date. We found that sometimes a system process would go through and update the last modified date of sites, even though nothing has changed. If you need to be sure, you can use SPSiteDataQuery to check all the contents of the site.

0

Try the following:

SELECT FullUrl, Title, TimeCreated 
FROM dbo.AllWebs
  • There was no reason not to approve this answer as it is still valid. Wrong on many levels but still gets you where you want to be :) – Paul Strupeikis Nov 4 '16 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.