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

Thomas Kurth

Principal Workplace Consultant at baseVISION AG
I’m a consultant, trainer and architect for workplace management and enterprise mobility projects with Microsoft Technologies in the past eight years. I love to push and design the modern workplace based on Windows 10, EM&S and O365 for my customers which is the only answer for the current security threats, agile world and the fast-changing business requirements of my customers. Important for me is to simplify and automate the operational processes, because there are the highest costs.

MCSEMCTCMCE
Thomas Kurth
Follow me

Latest posts by Thomas Kurth (see all)