Logo 
Search:

Sharepoint 2010 Articles

Submit Article
Home » Articles » Sharepoint 2010 » Content ManagementRSS Feeds

Check whether the item is in hold in SharePoint 2010 using powershell

Posted By: Vijai Anand Ramalingam     Category: Sharepoint 2010     Views: 1781

In this article we will be seeing whether the list item is in hold in SharePoint 2010 using powershell.

In Shared Documents I have a document "New”, here I am going to check whether the item is in hold or not using powershell.

Go to Start => All Programs => Microsoft SharePoint 2010 Products => SharePoint 2010 Management Shell => Run as an administrator. =>
Run the following script.

$site = get-SPSite("
http://servername:22222/sites/Test/")
$web = $site.RootWeb
$list = $web.Lists["Shared Documents"]
foreach ($item in $list.Items)
{
 if ($item.DisplayName.ToString() -eq "New")
 {
   if([Microsoft.Office.RecordsManagement.Holds.Hold]::IsItemOnHold($item))
   {
      write-host -f green $item.DisplayName "is on hold"
   }
 }
}

Share: 



Vijai Anand Ramalingam
Vijai Anand Ramalingam author of Check whether the item is in hold in SharePoint 2010 using powershell is from India. Vijai Anand Ramalingam says Hello Everyone,
I am Vijai Anand Ramalingam from India
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!