.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Get all the items from Hold Reports list using powershell

Posted By:Vijai Anand. R       Posted Date: May 14, 2011    Points: 40    Category: SharePoint    URL: http://www.dotnetspark.com  

n this we will be seeing how to get all the items from Hold Reports list using powershell
 

I have a SharePoint site and I have activated the Site feature (Go to Site Actions => Site Settings => Site Actions => manage Site features) "Hold and eDiscovery".

I have two items in the "Hold Reports" (Go to Site Actions => Site Settings => Hold and eDiscovery  => Hold Reports).

We are going to retrieve these items 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
$holds=[Microsoft.Office.RecordsManagement.Holds.Hold]::GetHoldReportsList($web)
write-host -f green "HoldsReportList:  " $holds.Title
foreach($item in $holds.Items)
{
  write-host $item.DisplayName
}
$web.Dispose()
$site.Dispose()



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend