Report the last access time stamp of site collections to find stale content
For this requirement, you need two reports as below
We will not talk about the first point as it’s very easy and you can prepare it in a simple manner via PowerShell. In case of any queries then please let me know.
Regarding second point which is our main agenda / goal – This can be extracted via SQL Query!
Please refer the following SQL Query which will accomplish this requirement.
SELECT
FullUrl
AS
'Site URL'
, TimeCreated,
DATEADD(d,DayLastAccessed + 65536,
CONVERT
(datetime,
'1/1/1899'
, 101))
lastAccessDate
FROM
Webs
WHERE
(DayLastAccessed <> 0)
AND
(FullUrl
LIKE
N
'sites/%'
)
ORDER
BY
You need to run this query against the specific content database and extract the report.