I want to add custom data retention to my site collection in this way:

  • Documents must be deleted after 3 years old (default option)
  • After 3 years, delete all versions except the latest and two previous versions

I'm guessing this policy isn't available by default and must be coded in PowerShell (?). Can someone guide me to the right direction. I'm not familiar with SharePoint or PowerShell (I do have some basic programming knowledge).

  • Are you using Content Types in your document library? Then it is easy to set this policy. – Biju Joseph - MCSD Oct 28 '13 at 12:23
  • Yes I am sir. I couldn't see the option anywhere. – Bashar al-Assad Oct 28 '13 at 12:30
  • I only see "Delete all previous versions" in the Action-menu. Thanks. – Bashar al-Assad Oct 28 '13 at 12:44

You need to create and register custom expiration action, i.e. implement the IExpirationAction interface. You will also have to implement the version deletion yourself. See this or this tutorial on registering custom action. The action will become available in the expiration policy settings after you register it.

| improve this answer | |

Got to /_layouts/mngctype.aspx. Click on the Content Type you want to set the retention properties. Click on information management policy settings

Go to site content type information

You will see Retention option

enter image description here

| improve this answer | |
  • Thanks for your reply. I know where the Retention option is and what options are available. I've already set a retention to delete documents after three years. I want to set a retention to delete all versions of a document except the latest version and two previous. – Bashar al-Assad Oct 28 '13 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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