Setting up Document Expiration and Retention Policies for Libraries in SharePoint 2010

The following could be useful for someone who is trying to setup a Document Expiration and Retention Policies for a library in SharePoint 2010:

Check List:

1. Central Administrator should have retention enabled for sites created:

Central Administration > Security > Information policy > Configure Information Management Policy > Retention [Available for use in new site and list policies]

2. “Information Management Policy” and “Expiration Policy” are the two timer jobs which are responsible for retention policy. By default both will work “Weekly”, change this to suite your need.

Note: Set the recurring schedule in such a way that “Information Management Policy” job should run before the “Expiration Policy”.

[For testing purposes, you can either execute “Run Now” or set a shorter interval like every 5 minutes]

Steps to configure an Expiration Policy as below:

1. [Designated Document Library] > Document Library Settings > Information management policy settings >

a. Library and Folders (Change source or configure library schedule) > [Select Library and Folders].

b. Add a retention stage… > “This stage is based off a date property of the item Time Period :” Created + e.g. 0 days (for immediate action) > Action [Select Move to Recycle Bin]

c. Press OK/Apply to save the changes.

2. Add a document to the [Designated Document Library] and wait for the “Expiration Policy” timer job to execute.

That’s it; you should see that the item has been moved to the recycle bin.

Setting Expiration Dates

In SharePoint 2010, you have the option to set an expiration time based on any date property available in the drop-down list shown in Figure 8-5, including when it was declared a record. You can specify values between 0 to 500 years, 0 to 6000 months, or 0 to 182,500 days from the date selected from the drop-down list. In reality, all three settings have the same maximum amount of time, so your choice of which to select is really based on how precise you want the date setting to be. Selecting days will give you a more precise setting than months, and months will be more precise than years. The precision of the retention period required by your organization should be determined by your legal team.

Related references:

Retention Policy for document library in SharePoint 2010

http://weblogs.asp.net/sreejukg/archive/2010/11/11/retention-policy-for-document-library-in-sharepoint-2010.aspx

Creating a retention policy to start a workflow in SharePoint 2010 using PowerShell

http://get-spscripts.com/2011/08/creating-retention-policy-to-start.html

Bulk provisioning SharePoint 2010 document retention policies using PowerShell:

http://www.sharemuch.com/2011/04/11/bulk-provisioning-sharepoint-2010-document-retention-policies-using-powershell/

Add a workflow to a SharePoint list in all sites of a site collection using PowerShell

http://get-spscripts.com/2010/08/add-workflow-to-sharepoint-list-in-all.html

ServerTemplate values–“<Lists ServerTemplate=’301’ />”

When creating a list or writing site data query (using SPSiteDataQuery) we all need to indicate the value for “ServerTemplate” attribute, I will leave a list here for my own reference and for anyone who may need these values:

100

Generic list

101

Document library

102

Survey

103

Links list

104

Announcements list

105

Contacts list

106

Events list

107

Tasks list

108

Discussion board

109

Picture library

110

Data sources

111

Site template gallery

112

User Information list

113

Web Part gallery

114

List template gallery

115

XML Form library

116

Master pages gallery

117

No-Code Workflows

118

Custom Workflow Process

119

Wiki Page library

120

Custom grid for a list

130

Data Connection library

140

Workflow History

150

Gantt Tasks list

200

Meeting Series list

201

Meeting Agenda list

202

Meeting Attendees list

204

Meeting Decisions list

207

Meeting Objectives list

210

Meeting text box

211

Meeting Things To Bring list

212

Meeting Workspace Pages list

300

Portal Sites list

301

Blog Posts list

302

Blog Comments list

303

Blog Categories list

850

Page Library

1100

Issue tracking

1200

Administrator tasks list

2002

Personal document library

2003

Private document library

Pre-Populating Folder(s) in Document Library with the Help of List Instance Definition

Scenario:

Today when I was working on a requirement, I had the need to create a customized picture library. To create this picture library the required List Schema, Definition, Instance Template, etc. were created.

Challenge:

One challenge I had at the end was, that this Library had to be pre-populated with a folder to store some control files.
Here is how it was resolved:

Note: I will not explain how the list definition and schema were created as there are several posts out there to help.

Solution:

In the List Instance definition (manifest file), you just have to add the line shown below (Module.. Path..):

   1:  <?xml version="1.0" encoding="utf-8" ?>
   2:  <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   3:   
   4:    <ListInstance FeatureId="327B763B-A5E7-4ac2-8458-B6570D362C0B"
   5:                 Id="WattsUpImagesLibrary"
   6:                 Title="$Resources:MyResource,ListInstance_WattsUpImages_DisplayName"
   7:                 Description="$Resources:MyResource,ListInstance_WattsUpImages_Description"
   8:                 Url="WattsUpImagesLibrary"
   9:                 TemplateType="3111" 
  10:                 OnQuickLaunch="FALSE" />
  11:    <!-- Adding a folder to the list instance-->
  12:    <Module Path="ControlFiles" Url="WattsUpImagesLibrary/ControlFiles" />
  13:  </Elements>

Please take a special note of the URL attribute, the value “WattsUpImagesLibrary” is the one used above as URL of the instance.

The output as a result of this:

image

IMPORTANT: To be able to create folder in Document Library, your list need to have the content reference of “0x0120” OR a custom one derived from it in the format of 0x0120 + 00 + <Guid>