1

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?

1

3 Answers 3

4

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)
FROM IISLogs
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)

0

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

-1

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

pyaarey.wordpress.com/2012/11/17/find-unused-sites-based-on-last-accessed-date/

Get Last Accessed date for a site

blogs.msdn.microsoft.com/varun_malhotra/2010/05/11/moss-2007-get-last-accessed-date-for-a-site/

Last Accessed Date for a Site Collection

https://danieljroberts.wordpress.com/2011/09/05/usage-data-in-sharepoint-powershell-retrieval/

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
  • 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
    Jul 19, 2017 at 11:08

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.