SOLVED
Home

Create a full holds reports in Sharepoint 2010 Records Center using Powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-480439%22%20slang%3D%22en-US%22%3ECreate%20a%20full%20holds%20reports%20in%20Sharepoint%202010%20Records%20Center%20using%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-480439%22%20slang%3D%22en-US%22%3EGood%20morning%2C%20I'm%20trying%20to%20create%20a%20Powershell%20script%20where%20I%20can%20get%20the%20list%20of%20all%20holds%20of%20my%20records%20center%20and%20the%20items%20on%20hold%20linked%20to%20them%20instead%20of%20parsing%20each%20Excel%20file%20of%20the%20Hold%20Reports.%20Is%20there%20a%20way%20for%20that%3F%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-480439%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2010%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-480613%22%20slang%3D%22en-US%22%3ERe%3A%20Create%20a%20full%20holds%20reports%20in%20Sharepoint%202010%20Records%20Center%20using%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-480613%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F324995%22%20target%3D%22_blank%22%3E%40lgouveajr%3C%2FA%3E%26nbsp%3BYou%20could%20try%20something%20like%20this%20not%20100%25%20but%20some%20thing%20similar%3C%2FP%3E%3CDIV%3E%3CSPAN%3E%5BMicrosoft.SharePoint.SPWeb%5D%24web%20%3D%20Get-SPWeb%20%24RecordCenterURL%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%24list%20%3D%20%24web.Lists%5B%22MyList%22%5D%3CBR%20%2F%3E%24spQuery%20%3D%20New-Object%20Microsoft.SharePoint.SPQuery%3CBR%20%2F%3E%24spQuery.Query%20%3D%20%24list.Views%5B%22ViewName%22%5D.Query%3CBR%20%2F%3E%24items%20%3D%20%24list.GetItems(%24spQuery)%3CBR%20%2F%3E%24cntItems%20%3D%200%3CBR%20%2F%3Eforeach(%24item%20in%20%24items)%3CBR%20%2F%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eif%20((%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fapi%2Fmicrosoft.office.recordsmanagement.recordsrepository%3Fview%3Dsharepoint-server%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%5BMicrosoft.Office.RecordsManagement.RecordsRepository%5D%3C%2FA%3E.IsOnHold%20is%20true)%20%7B%3CBR%20%2F%3Ewrite-output%20%22%24(%24item.url)%20%22%3CBR%20%2F%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%3CBR%20%2F%3E%24cntItems%2B%2B%3CBR%20%2F%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-480617%22%20slang%3D%22en-US%22%3ERe%3A%20Create%20a%20full%20holds%20reports%20in%20Sharepoint%202010%20Records%20Center%20using%20Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-480617%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F121767%22%20target%3D%22_blank%22%3E%40Naveen%20Karla%3C%2FA%3EWhich%20list%20should%20I%20use%20for%20the%20%3CSTRONG%3EMyList%3C%2FSTRONG%3E%3F%20The%20drop-off%20library%2C%20holds%20list%20or%20the%20record%20library%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
lgouveajr
New Contributor
Good morning, I'm trying to create a Powershell script where I can get the list of all holds of my records center and the items on hold linked to them instead of parsing each Excel file of the Hold Reports. Is there a way for that?
3 Replies
Highlighted

@lgouveajr You could try something like this not 100% but some thing similar

[Microsoft.SharePoint.SPWeb]$web = Get-SPWeb $RecordCenterURL
$list = $web.Lists["MyList"]
$spQuery = New-Object Microsoft.SharePoint.SPQuery
$spQuery.Query = $list.Views["ViewName"].Query
$items = $list.GetItems($spQuery)
$cntItems = 0
foreach($item in $items)
{
if (([Microsoft.Office.RecordsManagement.RecordsRepository].IsOnHold is true) {
write-output "$($item.url) "
}

$cntItems++
}

 

Highlighted

@Naveen KarlaWhich list should I use for the MyList? The drop-off library, holds list or the record library?

Highlighted
Solution

@lgouveajr Run this in holds list and see if it works.

 

You know what there is a property compliance info. 

https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-server/mt827784(v%3Doffice.15)

 

 

foreach($item in $items)
{
if (([Microsoft.Office.RecordsManagement.RecordsRepository].IsOnHold is true) {
write-output "$($item.ComplianceInfo) "
}

 

Related Conversations
Report for Videoconferencing quality
Thomas_Steibl in Microsoft Teams on
3 Replies
A Communication Compliance Walk-Thru
Jamie Bertha in Office 365 on
0 Replies
A Communication Compliance Walk-Thru
Jamie Bertha in Microsoft Teams on
0 Replies
Get Sharepoint site file count with powershell
RahamimL in SharePoint on
2 Replies