LastContentModifiedDate using PowerShell not equal to actual date in SharePoint Admin

New Contributor

I've created a report using PowerShell to get an overview of inactive SharePoint Sites using the LastContentModifiedDate property of the SharePoint object.

 

LastContentModified3.png

 

But when I compare the date to the last modified in the SharePoint Admin I'm getting a different date.
It looks like the LastContentModifiedDate is nog reflecting the correct date.
LastContentModified1.pngLastContentModified2.png

Tried this on different Tenants and SharePoint sites. Is this correct of is there a better way to get the Last-Content-Modified date using powershell?

1 Reply

@Istvan Ybema 

Apparently that date gets update by some kind of timer job.
You can find the correct date with the LastItemUserModifiedDate property of the web object.

 

$oWeb = Get-PnPWeb -Includes LastItemUserModifiedDate
$oContentModifiedDate = $oWeb.LastItemUserModifiedDate