Monday, 23 July 2018

SharePoint 2013: Get all the Last accessed sites


That we can get from DB side only as SharePoint PowerShell is not have any LastAccessedItem (Something as LastModifiedItem) property.

Run this DB script:-

SELECT FullUrl AS 'Enter the 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 LastAccessedDate

No comments:

Post a Comment