I need to programatically set a separate retention policy for specific files that are already uploaded in a document library in SharePoint 2016 on Prem version.

Is it possible to do so?

Let me know the solution for the above scenario.

1 Answer 1


Yes, it's doable. On the library settings you turn your head to "Information management policy setting".


  1. Site Collection
  2. Content Type
  3. Document Library
  4. Folder

Reference: How to set up retention and deletion policies for files and folders in SharePoint

  • Thanks, I already went through this and how my question differs from this is I have 100 files inside a document library and I need to update only two files out of 100 files inside the library with a different retention policy.
    – Sumudu P
    Jan 24, 2019 at 13:16
  • @SumuduP Then you need to move those document to a different document library, or use a specific content type type to accomplist this effect. (The easiest way is to make a new CT who inherits current document type, and name it Retention Policy B for CT xxx).
    – Benny Skogberg
    Jan 24, 2019 at 13:21
  • I have been trying with your solution and I have created a new CT and applied the retention policy to it. How do you apply CT only to selected files inside a document library? Normally CT is applied to all the files in the document library.
    – Sumudu P
    Jan 25, 2019 at 9:45
  • @SumuduP You can add more than one CT to a library and that would solve your problem if you assign retention policy CT to document A, B and C and the other CT to document D, E and F.
    – Benny Skogberg
    Jan 25, 2019 at 10:20
  • 1
    ♦ Yes, your solution is working for my scenario. I used a separate content type and applied to the document.
    – Sumudu P
    Jan 30, 2019 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.