How to find files that were created more than a year ago?

%3CLINGO-SUB%20id%3D%22lingo-sub-1359593%22%20slang%3D%22en-US%22%3EHow%20to%20find%20files%20that%20were%20created%20more%20than%20a%20year%20ago%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1359593%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20tasked%20to%20find%20all%20the%20files%20in%20a%20document%20library%20that%20has%20creation%20date%20is%20older%20than%201%20year.%26nbsp%3B%20Now%20this%20is%20a%20modern%20Team%20site%2C%20and%20files%20were%20copied%20to%20this%20library%20using%20ShareGate.%20When%20I%20say%20creation%20date%2C%20I%20mean%20the%20original%20creation%20date%20of%20the%20file%2C%20not%20the%20date%20that%20the%20files%20was%20copied%20to%20SP.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%2C%20trying%20to%20find%20it%20using%20PowerShell%2C%20I%20am%20doing%20this%3A%3C%2FP%3E%3CP%3E%24afile%20%3D%20Get-PnPListItem%20-id%2017%20-List%203db40bc0-9bcc-88xx-a7e0-ab7b9e0910a1%3C%2FP%3E%3CP%3E%24afile.FieldValues%3C%2FP%3E%3CP%3EFieldValues%20has%20%22Created%22%20and%20%22Created_x0020_Date%22.%20Both%20have%20same%20value.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20question%20is%2C%20can%20I%20rely%20on%20this%20data%20and%20assume%20that%20%22Created%22%20or%20%22Created_x0020_Date%22%20has%20actually%20the%20original%20file%20creation%20date%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1359593%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1359943%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20find%20files%20that%20were%20created%20more%20than%20a%20year%20ago%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1359943%22%20slang%3D%22en-US%22%3EHi%2C%20Sharegate%20will%20maintain%20the%20metadata%20info%20while%20copying%20files%20from%20the%20source%20to%20destination.%20You%20can%20rely%20on%20the%20tool%20and%20for%20sure%20you%20can%20use%20the%20Created%20field%20info%20as%20the%20file%20created%20date%20not%20the%20copied%20date.%20If%20you%20are%20not%20convinced%2C%20you%20can%20compare%20the%20source%20and%20the%20destination%20for%20few%20random%20files.%3CBR%20%2F%3E%3CBR%20%2F%3EHope%20it%20helps%2C%20please%20like%20it%20or%20mark%20it%20as%20a%20solution%20if%20it%20resolves%20ur%20clarification%20or%20issue%3CBR%20%2F%3E-Sudharsan%20K...%3C%2FLINGO-BODY%3E
Highlighted
Contributor

I am tasked to find all the files in a document library that has creation date is older than a year.  Now this is a modern Team site, and files were copied to this library using ShareGate. When I say creation date, I mean the original creation date of the file, not the date that the files were copied to SP. 

 

Now, trying to find it using PowerShell, I am doing this:

$afile = Get-PnPListItem -id 17 -List 3db40bc0-9bcc-88xx-a7e0-ab7b9e0910a1

$afile.FieldValues

FieldValues has "Created" and "Created_x0020_Date". Both have same value.  

 

My question is, can I rely on this data and assume that "Created" or "Created_x0020_Date" has actually the original file creation date? 

 

1 Reply
Highlighted
Hi, Sharegate will maintain the metadata info while copying files from the source to destination. You can rely on the tool and for sure you can use the Created field info as the file created date not the copied date. If you are not convinced, you can compare the source and the destination for few random files.

Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...