Get the list of holds for the specified item using Powershell and programmatically in SharePoint


In this article we will be seeing how to get the list of holds for the specified list item using powershell and programmatically in SharePoint 2010.

For Holds and Hold Reports in SharePoint 2010 http://www.c-sharpcorner.com/UploadFile/anavijai/5103/  (Copy the hyperlink).

I have created two hold items "HR" and "Finance" in the Holds list


Which is available in Site Actions => Site Settings => Hold and eDiscovery => Holds.






In the Shared documents I have an item "New" for which both "HR" and "Finance" holds are added.


Programmatically get the list of holds for the item "New":

1. Open Visual Studio 2010.

2. Create a new console application.

3. Add the following references.

a. Microssoft.Office.Policy.dll

b. Microsoft.SharePoint.dll

4. Add the following namespaces.

a. using Microsoft.SharePoint;

b. using Microsoft.Office.RecordsManagement.Holds;

5. Replace the code with the following.

  1. using System;

  2. using System.Collections.Generic;

  3. using System.Linq;

  4. using System.Text;