SOLVED

Get-SPOSite / LastContentModifiedDate - Details

%3CLINGO-SUB%20id%3D%22lingo-sub-77663%22%20slang%3D%22en-US%22%3EGet-SPOSite%20%2F%20LastContentModifiedDate%20-%20Details%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-77663%22%20slang%3D%22en-US%22%3E%3CP%3EWhenever%20you%20trigger%20a%20get-sposite%20with%20details%20of%20a%20SPO%20Site%20(Powershell)%2C%20you%20get%20the%20property%20%22LastContentModifiedDate%22%20back.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20wondering%20what%20this%20property%20is%20all%20about%20because%20i%20see%20for%20several%20Sites%20an%20exact%20timestamp%20(in%20the%20middle%20of%20the%20night%20where%20i%20know%20for%20sure%20that%20none%20of%20my%20users%20are%20working%3A)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20attached%20screenshot%20you%20see%20a%20timestamp%20of%201%3A56am%3C%2FP%3E%3CP%3E--%26gt%3B%20so%20multiple%20Sites%20are%20showing%20this%20timestamp%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EQuestions%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ECan%20i%20rely%20on%20that%20property%20whenever%20i%20want%20to%20detect%20if%20a%20User%20has%20modified%20something%20within%20a%20Site%20%3F%3C%2FP%3E%3CP%3EAre%20there%20any%20Backend%20O365%20Processes%20in%20place%20which%20COULD%20influence%20this%20timestamp%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-77663%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-84422%22%20slang%3D%22en-US%22%3ERe%3A%20Get-SPOSite%20%2F%20LastContentModifiedDate%20-%20Details%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-84422%22%20slang%3D%22en-US%22%3E%3CP%3EI%20opened%20a%20Microsoft%20support%20ticket%20last%20year%20because%20I%20wanted%20to%20know%20what%20triggered%20the%20date%20modified%20to%20change%20(ticket%20%23%26nbsp%3B116063014358281).%26nbsp%3B%20We%20have%20several%20custom%20code%20solutions%20that%20upload%20documents%2Freports%20weekly%20or%20daily%2C%20and%20those%20sites%20weren't%20always%20showing%20as%20being%20modified.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETurns%20out%20that%20our%20code%20wasn't%20triggering%20the%20modified%20date%20to%20change%20because%20we%20weren't%20populating%20the%20user%20agent%20string%20on%20our%20request.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20actually%20the%20way%20we'd%20want%20it%20so%20our%20code%20doesn't%20make%20stale%20sites%20look%20active.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-78536%22%20slang%3D%22en-US%22%3ERe%3A%20Get-SPOSite%20%2F%20LastContentModifiedDate%20-%20Details%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-78536%22%20slang%3D%22en-US%22%3E%3CP%3Ethank%26nbsp%3B%20you%20annesh%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewell%20i%20know%20that%20this%20property%20gets%20changed%20whenever%20a%20user%20modifies%20something%20in%20the%20site.%3C%2FP%3E%3CP%3Ebut%20what%20i%20dont%20understand%20is%2C%20why%20i%20see%20a%20timestamp%20in%20the%20middle%20of%20the%20night%20where%20i%20know%20for%20sure%20(because%20it%20is%20a%20test%20site)%20that%20nothing%20has%20been%20changed%20by%20anyone%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eso%20i%20believe%20that%20certain%20processes%20in%20the%20background%20are%20influecing%20this%20property%20which%20makes%20it%20almost%20useless%20to%20detect%20last%20user%20modifications....right%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eopinions%20welcome%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-78483%22%20slang%3D%22en-US%22%3ERe%3A%20Get-SPOSite%20%2F%20LastContentModifiedDate%20-%20Details%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-78483%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Stefan%2C%3C%2FP%3E%3CP%3EThis%20shows%20the%20date%20and%20time%20in%20%3CSTRONG%3EUTC%20format%3C%2FSTRONG%3E%20(probably%20the%20reason%20why%20it%20shows%20midnight%20for%20you)%20when%20the%20content%20of%20the%20site%20was%20last%20changed.%20So%20any%20site%20activity%20that%20makes%20a%20change%20in%20the%20content%20database%20add%20to%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERef%3A%20%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.sharepoint.spsite.lastcontentmodifieddate.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.sharepoint.spsite.lastcontentmodifieddate.aspx%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20helps!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2299555%22%20slang%3D%22en-US%22%3ERe%3A%20Get-SPOSite%20%2F%20LastContentModifiedDate%20-%20Details%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2299555%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F44882%22%20target%3D%22_blank%22%3E%40Stefan%20Fried%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EHave%20you%20found%20a%20solution%20for%20this%3F%20I've%20been%20meaning%20to%20use%20this%20as%20a%20way%20to%20monitor%20onedrive%20personal%20backups%20but%20I%20come%20across%20the%20same%20issue%20where%20some%20background%20processes%20are%20intervening.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Super Contributor

Whenever you trigger a get-sposite with details of a SPO Site (Powershell), you get the property "LastContentModifiedDate" back.

 

I'm wondering what this property is all about because i see for several Sites an exact timestamp (in the middle of the night where i know for sure that none of my users are working:)

 

In the attached screenshot you see a timestamp of 1:56am

--> so multiple Sites are showing this timestamp

 

 

Questions:

Can i rely on that property whenever i want to detect if a User has modified something within a Site ?

Are there any Backend O365 Processes in place which COULD influence this timestamp ?

 

4 Replies

Hello Stefan,

This shows the date and time in UTC format (probably the reason why it shows midnight for you) when the content of the site was last changed. So any site activity that makes a change in the content database add to this.

 

Ref: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.lastcontentmodifieddate.aspx

 

Hope this helps!

thank  you annesh

 

well i know that this property gets changed whenever a user modifies something in the site.

but what i dont understand is, why i see a timestamp in the middle of the night where i know for sure (because it is a test site) that nothing has been changed by anyone

 

so i believe that certain processes in the background are influecing this property which makes it almost useless to detect last user modifications....right ?

 

opinions welcome

best response confirmed by Stefan Fried (Super Contributor)
Solution

I opened a Microsoft support ticket last year because I wanted to know what triggered the date modified to change (ticket # 116063014358281).  We have several custom code solutions that upload documents/reports weekly or daily, and those sites weren't always showing as being modified.

 

Turns out that our code wasn't triggering the modified date to change because we weren't populating the user agent string on our request.

 

This is actually the way we'd want it so our code doesn't make stale sites look active.

 

Hope this helps.

@Stefan Fried 

Have you found a solution for this? I've been meaning to use this as a way to monitor onedrive personal backups but I come across the same issue where some background processes are intervening.