LastContentModifiedDate using PowerShell not equal to actual date in SharePoint Admin

%3CLINGO-SUB%20id%3D%22lingo-sub-1453257%22%20slang%3D%22en-US%22%3ELastContentModifiedDate%20using%20PowerShell%20not%20equal%20to%20actual%20date%20in%20SharePoint%20Admin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1453257%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20created%20a%20report%20using%20PowerShell%20to%20get%20an%20overview%20of%20inactive%20SharePoint%20Sites%20using%20the%20LastContentModifiedDate%20property%20of%20the%20SharePoint%20object.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LastContentModified3.png%22%20style%3D%22width%3A%20477px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197843iA09D064BDF991B38%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22LastContentModified3.png%22%20alt%3D%22LastContentModified3.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20when%20I%20compare%20the%20date%20to%20the%20last%20modified%20in%20the%20SharePoint%20Admin%20I'm%20getting%20a%20different%20date.%3CBR%20%2F%3EIt%20looks%20like%20the%26nbsp%3BLastContentModifiedDate%20is%20nog%20reflecting%20the%20correct%20date.%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LastContentModified1.png%22%20style%3D%22width%3A%20665px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197844i561A2FE39DD25730%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22LastContentModified1.png%22%20alt%3D%22LastContentModified1.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LastContentModified2.png%22%20style%3D%22width%3A%20503px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F197845i2123719AE7D1A482%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22LastContentModified2.png%22%20alt%3D%22LastContentModified2.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3ETried%20this%20on%20different%20Tenants%20and%20SharePoint%20sites.%20Is%20this%20correct%20of%20is%20there%20a%20better%20way%20to%20get%20the%20Last-Content-Modified%20date%20using%20powershell%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1453257%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESites%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
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