File last accessed date - SharePoint Tenant.

%3CLINGO-SUB%20id%3D%22lingo-sub-1877562%22%20slang%3D%22en-US%22%3EFile%20last%20accessed%20date%20-%20SharePoint%20Tenant.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1877562%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20PowerShell%20script%20that%20runs%20across%20a%20whole%20SharePoint%20tenant%20that%20will%20find%20all%20files%20that%20have%20not%20been%20accessed%20for%20a%20specific%20date%20range%20(say%207%20years)%3F%20We%20are%20looking%20at%20setting%20up%20retention%20policies%20but%20need%20to%20understand%20the%20impact%20on%20the%20business.%26nbsp%3BIdeally%20the%20end%20result%20would%20be%20a%20csv%20file%20with%20the%20file%20name%2C%20URL%2C%20size%2C%20when%20it%20was%20last%20accessed%20and%20the%20file%20creator%20principal%20ID.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1877562%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFiles%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EUsage%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

Is there a PowerShell script that runs across a whole SharePoint tenant that will find all files that have not been accessed for a specific date range (say 7 years)? We are looking at setting up retention policies but need to understand the impact on the business. Ideally the end result would be a csv file with the file name, URL, size, when it was last accessed and the file creator principal ID.

0 Replies