none
[Solved] How to Clear Warning on Distribution Point ("Failed to retrieve the package list on the distribution point") RRS feed

  • General discussion

  • Hello Every One,

    After a hard week i managed to completely clear the warning on one of my DP's ("Failed to retrieve the package list on the distribution point")

    i will list every step i gone through to clear this message.

    This problem is due to mismatch between Packages listed in Content Library  and in WMI.

    so first Thing to do is to create excel sheet to list all packages in content library and WMI to compare between them and know what packages are causing this Warning.

    this massage was appearing on my primary server which has DP rule installed.

    1-navigate to your server file explorer and go to contentlib Folder and open PKG folder, you will notice that it contain a lot of files each one named by the id of one of the packages so you can open command prompt in this location then execute Dir command and copy pkgs id to the first column of the excel sheet.

    2-open sccm Manager and navigate to monitoring >> distribution status >> content status and write all packages ID's in the Excel sheet

    3-in start type wbemtest.exe and open as administrator

    connect to root\sccmdp

    click open instance and type SMS_Packagesincontlib then click instances 

    you will find all packages stored in WMI list them in Excel sheet 

    now you can start comparing between them to see the difference 

    if there is a package in wmi and doesn't exist in content lib and and content status mark it and press delete button in wmi tester
    if there is a package in content lib that doesn't exist in wmi navigate to it's location then  right click on it and click update distribution points
    if there is a package in contentlib folder that doesn't in content status delete the file from the folder

    after you ensure that all the three locations have the same packages IDs run content validation task on Distribution Point 
    from task scheduler >> Task Scheduler Library >>Microsoft >>configuration Manager >>content validation

    then go to SCCM Logs and open smsdpmon.log and ensure that this error doesnot appear after content validation task started  "The package data in WMI is not consistent to PkgLib"
    if there is an error validating one of the packages check that package and try the task again 

    after task is finished you can see that the warning is cleared

    Thank you.

    Monday, January 15, 2018 7:35 PM

All replies

  • This is great.

    Let me add that you cannot copy and paste from the WBEMTEST Instance window (or at least I could not).  The following Powershell script (run on the Distribution Point) can be used to list the instances so they can be copied and pasted into Excel:

    $objCol = get-wmiobject -namespace root/sccmdp -class "SMS_Packagesincontlib"
    foreach ($item in $objCol) {
        $item.PackageID
    }

    Thursday, February 1, 2018 5:12 PM
  • Hello,

    If I'm correct you can also solve this with a powershell script from Bart Serneels. For more information see -> 

    http://gallery.technet.microsoft.com/Powershell-script-to-fix-81dc4e69




    Monday, February 5, 2018 11:06 AM
  • Did you try this scrip in production? 

    Can you confirm that this script solved the problem for you? 

    Monday, February 5, 2018 5:28 PM
  • I've used the Bat Serneels' script and it does part of the work.  It definitely does the comparison between the primary site server's content and the WMI piece on the distribution point. 

    What I have found though is it does not compare the the items in the PKGLIB folder to either the primary site server's content or to entries in WMI.  

    CSE505 lists 3 things to check:

    >> "if there is a package in wmi and doesn't exist in content lib and and content status mark it and press delete button in wmi tester"

    This is done using Bart's script

    >> "if there is a package in content lib that doesn't exist in wmi navigate to it's location then  right click on it and click update distribution points"

    Bart's script does not do this comparison

    >> "if there is a package in contentlib folder that doesn't in content status delete the file from the folder"

    Bart's script does NOT do this comparison



    Now to be fair, I've used the script and for many DPs it has solved the problem for me.  But for those DPs where the script says "all is good" but content validation still fails, the procedure listed by CSE505 seems more complete and has worked for me.  
    Thursday, February 8, 2018 4:28 PM
  • I'm happy it worked for you.
    Saturday, February 10, 2018 8:30 PM
  • I know this thread is old, but for those who stumble across it while researching this problem, I have written a script that automates all steps of CSE505's approach.  Thanks CSE505 for sharing the knowledge!

    https://adminsccm.com/2018/11/21/script-to-repair-distribution-point-content-library-inconsistencies/

    Thursday, November 22, 2018 1:01 AM
  • I have been using this one then running the content validation to clear errors. once all clear the content library cleanup tool works also.

    # Run Part 1 First to Enter Remote Session
    # Part 1
    
    $SystemName = Read-Host "SystemName "
    Try{
    Enter-PSSession $SystemName}
    Catch{write-host "Failed to Connect"
    # D:\support\PSTools\PsExec.exe \\$systemName -s winrm.cmd quickconfig -q
    # Enter-PSSession $SystemName
    }
    
    #Run Part 2 AFTER PSsession started
    # Part 2a
    
    $WMIPkgList = Get-WmiObject -Namespace Root\SCCMDP -Class SMS_PackagesInContLib | Select -ExpandProperty PackageID | Sort-Object
    $ContentLib = (Get-ItemProperty -path HKLM:SOFTWARE\Microsoft\SMS\DP -Name ContentLibraryPath)
    $PkgLibPath = ($ContentLib.ContentLibraryPath) + "\PkgLib"
    $PkgLibList = (Get-ChildItem $PkgLibPath | Select -ExpandProperty Name | Sort-Object)
    $PkgLibList = ($PKgLibList | ForEach-Object {$_.replace(".INI","")})
    $PksinWMIButNotContentLib = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq "<=" } 
    $PksinContentLibButNotWMI = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq "=>" } 
    
    Write-Host Items in WMI but not the Content Library
    Write-Host ========================================
    $PksinWMIButNotContentLib
    
    Write-Host Items in Content Library but not WMI
    Write-Host ====================================
    $PksinContentLibButNotWMI
    
    # Possibly run above to check first only ###
    # Part 2b
    
    #To remove the item from WMI (Using the list from the previous script):
     Foreach ($Pkg in $PksinWMIButNotContentLib){write-host $Pkg
     Get-WmiObject -Namespace Root\SCCMDP -Class SMS_PackagesInContLib -Filter "PackageID = '$Pkg'" | Remove-WmiObject
     }
    
    #To remove INI files using the list from the previous script:
     Foreach ($Pkg in $PksinContentLibButNotWMI){write-host $Pkg
     Remove-Item -Path "$PkgLibPath\$Pkg.INI"
     }
    
     <#
     $PKgLibList.count
     $WMIPkgList.count
     $PksinContentLibButNotWMI.count
     $PksinWMIButNotContentLib.count
     #>
     
    # Run Part 3 AFTER part 2 completed
    # Part 3
    
    Exit-PSSession


    Thursday, November 22, 2018 1:12 AM