Is there a solution to detect site metadata change using CurrentChangeToken?

%3CLINGO-SUB%20id%3D%22lingo-sub-1384919%22%20slang%3D%22en-US%22%3EIs%20there%20a%20solution%20to%20detect%20site%20metadata%20change%20using%20CurrentChangeToken%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1384919%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20'%3CSPAN%3E%3CSTRONG%3EGet-PnPProvisioningTemplate%3C%2FSTRONG%3E'%20to%20backup%20site%20metadata.%20Running%20this%20cmdlet%20against%20SharepointOnline%20may%20take%20a%20long%20time.%20So%20I%20would%20like%20to%20run%20it%20against%20a%20site%20only%20if%20the%20site%20metadata%20has%20changed%20(say%20a%20new%20page%20was%20added%20or%20webpart%20was%20added%2C%20branding%20file%20changed%2C...)%20since%20I%20ran%20the%20cmdlet%20last%20time.%26nbsp%3B%20I%20was%20looking%20at%20the%20%3CA%20href%3D%22https%3A%2F%2Fblog.stefan-gossner.com%2F2009%2F12%2F04%2Fcontent-deployment-the-complete-guide-part-7-change-token-basics%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECurrentChangeToken%3C%2FA%3E%20object%20in%20the%20object%26nbsp%3B%20'%3CSTRONG%3E%3CSPAN%20class%3D%22xref%22%3EMicrosoft.SharePoint.Client.Site'%20r%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20class%3D%22xref%22%3Eeturned%20by%20%3CSTRONG%3EGet-PnPSite%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E%3CSPAN%20class%3D%22xref%22%3E.%20%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20class%3D%22xref%22%3EHowever%20in%20the%20token%3C%2FSPAN%3E%3CSPAN%20class%3D%22xref%22%3E%3CSTRONG%3E%20'%3C%2FSTRONG%3E%3CSPAN%3E%7BVersion%7D%3B%7BScope%7D%3B%7BGuid%7D%3B%7BChangeTime%7D%3B%7BChangeNumber%7D'%2C%20the%26nbsp%3B%26nbsp%3B%7BChangeTime%7D%3B%7BChangeNumber%7D%20keeps%20changing%20even%20when%20there%20is%20no%20apparent%20activity%20in%20any%20of%20the%20sites%20in%20my%20tenant.%20Is%20the%20token%20changing%20due%20to%20my%20query%20itself%3F%20Is%20there%20any%20way%20to%20detect%20whether%20site%20metadata%20(excluding%20List%20Item%20and%20Doc%20library)%20got%20modified%20using%20the%20change%20token%20or%20any%20other%20mechanism%3F%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1384919%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Senior Member

I am using 'Get-PnPProvisioningTemplate' to backup site metadata. Running this cmdlet against SharepointOnline may take a long time. So I would like to run it against a site only if the site metadata has changed (say a new page was added or webpart was added, branding file changed,...) since I ran the cmdlet last time.  I was looking at the CurrentChangeToken object in the object  'Microsoft.SharePoint.Client.Site' returned by Get-PnPSite. However in the token '{Version};{Scope};{Guid};{ChangeTime};{ChangeNumber}', the  {ChangeTime};{ChangeNumber} keeps changing even when there is no apparent activity in any of the sites in my tenant. Is the token changing due to my query itself? Is there any way to detect whether site metadata (excluding List Item and Doc library) got modified using the change token or any other mechanism?

0 Replies