I am archiving site collections if they are not in use anymore therefore I have a small linq query to get List's Last Item Modified Date.
rootWeb.Lists.Cast<SPList>().Where(l => !l.Hidden).Select(l => l.LastItemModifiedDate).Max()
It was working properly before Cumulative Update (KB4018302). After Cumulative Update (KB4018302), there are changes on Form Templates, Documents Libraries which I couldn't see.
I checked these libraries on SPD to see is there any new file has been added but there is no new file.
I checked our deployment scripts to be ensure I didn't broke anything many times but everything is fine.
I am not sure is there any timer job which effects these libraries ?
Does CU has effect on SPList.LastContentModifiedDate property ?
Do you have any suggestion to get proper last modified date of site collections? (Except SPWeb.LastItemModifiedDate,SPSite.LastContentModifiedDate)
Edit : I tried this powershell implementation according to one of responses, The dates are still not proper.
foreach ($wa in get-spwebapplication | where{ $_.Displayname -like "*Portal*"})
{
foreach ($site in $wa.Sites)
{
write-host $web
foreach ($web in $site.RootWeb)
{
$changeQuery = New-Object Microsoft.SharePoint.SPChangeQuery($false, $false);
$changeQuery.SystemUpdate = $false;
$changeQuery.List = $true;
$changeQuery.Item = $true;
$changeQuery.Folder = $true;
$changeQuery.Add = $true;
$changeQuery.Delete = $true;
$changeQuery.Update = $true;
$spChangeCollection = $web.GetChanges($changeQuery);
$LastItemModifiedDates = New-Object System.Collections.ArrayList
foreach ($change in $spChangeCollection)
{
$LastItemModifiedDates.Add($change.Time);
}
write-host ($LastItemModifiedDates | Measure -Max).Maximum
}
}
}