Forum Discussion

lgouveajr's avatar
lgouveajr
Copper Contributor
Apr 22, 2019
Solved

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

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?
  • 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 ((https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.recordsmanagement.recordsrepository?view=sharepoint-server.IsOnHold is true) {
    write-output "$($item.ComplianceInfo) "
    }

     

3 Replies

  • Naveen Karla's avatar
    Naveen Karla
    Iron Contributor

    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 ((https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.recordsmanagement.recordsrepository?view=sharepoint-server.IsOnHold is true) {
    write-output "$($item.url) "
    }

    $cntItems++
    }

     

    • lgouveajr's avatar
      lgouveajr
      Copper Contributor

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

      • Naveen Karla's avatar
        Naveen Karla
        Iron Contributor

        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 ((https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.recordsmanagement.recordsrepository?view=sharepoint-server.IsOnHold is true) {
        write-output "$($item.ComplianceInfo) "
        }

         

Resources