How to get last access date of any site collection/sites in SP2013?

I tried using Powershell, but we can only get lastItemModifiedDate Property or lastContentModifiedDate. Please suggest which is the best way to get the date "last access date" by users?

  • is your site public facing or intranet portal? If it is intranet portal, you can check users login time using below link: "sharepoint.stackexchange.com/questions/74598/…" Once you get the list, check the date descending and get top 1 record from array. Commented Jul 19, 2017 at 7:25

3 Answers 3


The last access date can't be queried through PowerShell, as the values of such are stored with an associated SQL database and initially created by the Windows Server's IIS. So in another words you are interested in IIS logs.

last access date/time for sharepoint site collections topic from MSDN forums has a suggestion regarding the site collections.

A pseudo-code version (where you'd need to fill in your data table's name and URL):

SELECT max(date)
WHERE url like 'http://server/sites/sitecollection%'

And a bit advanced query

SELECT FullUrl AS 'Site URL', TimeCreated,
DATEADD(d,DayLastAccessed + 65536, CONVERT(datetime, '1/1/1899', 101))
AS lastAccessDate FROM Webs WHERE
(DayLastAccessed <> 0) AND (FullUrl LIKE N'sites/%') ORDER BY lastAccessDate

(Source: Last access date/time for SharePoint site collections)


To my knowledge there is no last accessed date variable stored in the site collection.So I do not think you can get that using PowerShell .

You can look into logs to check for last request for that particular site collection


You could also try the PowerShell Commands which are given in the following articles to find out last accessed date.

Find unused sites based on Last Modified Date


Get Last Accessed date for a site


Last Accessed Date for a Site Collection


Additionally, you can try this automated solution ( https://www.lepide.com/lepideauditor/sharepoint-auditing.html ) which grants access to only specific reports to be accessed.

  • 1
    The first link only works for "last modified", not "last accessed". The second is a custom solution only for MOSS 2007 (while the requirement was for SP2013). The third link seemingly only returns the date when a site was visited the most. The fourth link seems like a promotion which doesn't directly address the requirement. In addition, this is a combo of link-onlys, which is what should be avoided to the maximum. If a link to an external source breaks one day, a valuable answer will be lost unless provided in here within enough detailed length.
    – moe
    Commented Jul 19, 2017 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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