Retention Policy Specific Folder

%3CLINGO-SUB%20id%3D%22lingo-sub-1315627%22%20slang%3D%22en-US%22%3ERetention%20Policy%20Specific%20Folder%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1315627%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20creating%20a%20retention%20policy%20for%20OneDrive%20that%20does%20not%20retain%20and%20deletes%20files%20older%20than%2030%20days.%26nbsp%3B%20The%20goal%20is%20to%20target%20only%20files%20in%20the%20%22Microsoft%20Teams%20Chat%20Files%22%20folder.%26nbsp%3B%20The%20only%20option%20might%20be%20using%20the%20advanced%20targeting%20feature%20and%20entering%20a%20search%20term%2C%20but%20not%20sure%20how%20that%20could%20look.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHas%20anyone%20been%20successful%20at%20doing%20this%20and%20might%20share%20their%20method%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1315627%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOneDrive%20for%20Business%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1316221%22%20slang%3D%22en-US%22%3ERe%3A%20Retention%20Policy%20Specific%20Folder%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1316221%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20cannot%20target%20policies%20to%20specific%20folder%2C%20and%20since%20this%20is%20a%20simple%20%22delete%22%20action%2C%20just%20run%20a%20flow%20or%20script%20it%20in%20CSOM%20instead.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I'm creating a retention policy for OneDrive that does not retain and deletes files older than 30 days.  The goal is to target only files in the "Microsoft Teams Chat Files" folder.  The only option might be using the advanced targeting feature and entering a search term, but not sure how that could look. 

 

Has anyone been successful at doing this and might share their method?

1 Reply

You cannot target policies to specific folder, and since this is a simple "delete" action, just run a flow or script it in CSOM instead.