WPNinjas HeaderWPNinjas Header

Error connecting to Distribution Point with Content Library Explorer

Today I had an issue with starting the Content Library Explorer which is contained in the ConfigMgr 2012 R2 Toolkit. The complete Error was “The legacy package does not have exactly one content.” like you can see in the next image.

image

This problem was also reported in the Technet forums but nobody had a easy or shareable solution for the problem. Now I created a PowerShell Script which will analyze the contentlib and report the packages with a problem back. You have only to modify the first line. The script has to be run on the distribution point with the issue.

$PathToDataLib = "E:\SCCMContentLib\DataLib" # Path to DataLib

####################################
# Get Legacy Package Folders
$folders = Get-ChildItem -LiteralPath $PathToDataLib | Where-Object { $_.Name.Length -ge 9 -and $_.Name.Length -le 11} | Select-Object -Property @{Name="Name";Expression={$_.Name.SubString(0,8)}}
$uniqueFolders = $folders | Select-Object -Property Name -Unique

# Display Statistics
Write-Host "Count of Folders found: $($folders.Count)"
Write-Host "Count of Unique Folders found: $($uniqueFolders.Count)"
Function Get-Duplicate {
    param($array, [switch]$count)
    begin {
        $hash = @{}
    }
    process {
        $array | %{ $hash[$_] = $hash[$_] + 1 }
        if($count) {
            $hash.GetEnumerator() | ?{$_.value -gt 1} | %{
                New-Object PSObject -Property @{
                    Value = $_.key
                    Count = $_.value
                }
            }
        }
        else {
            $hash.GetEnumerator() | ?{$_.value -gt 1} | %{$_.key}
        }   
    }
}

# Display Duplicated Packages
Get-Duplicate ($folders | Select -ExpandProperty Name) -count

The result will look like this:

image

After redeploying these packages the Content Library Explorer could be started without errors.

Follow me

2 Comments

BIgMike · July 29, 2016 at 10:30

Thomas,
Thanks for the script. I could not run Library Content Explorer either until I ran this script. Once I ran the script and identified the problem packages I just removed the problem DP from the packages and I could then connect successfully with the Content Explorer.
Again, many thanks

BigMike

    Thomas Kurth · July 29, 2016 at 10:54

    Hi Mike,
    Thanks for the Feedback!

    Have a nice day.
    Regards
    Thomas

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.