Issue: Fail to retried the package list on distribution point
Today we are discussing about distribution point having has miss match error fail to retried the package list on distribution point
Distribution points have packages in their WMI repository that don’t exist any longer on the site server. When the distribution point goes through a content validation cycle, it will fail and change its status to ‘Warning’.
The error you’ll see in the Distribution Point Configuration Status overview is
Error “Failed to validate content hash”
In some time you will see line of “Failed to retrieve the package list on the distribution point. Or the package list in content library doesn’t match the one in WMI. Review smsdpmon.log for more information about this failure. Then we have to look smsdpmon.log we do indeed see an error, 0x80070002 and the package ID in question. When we look up the package ID on the site server, it doesn’t exist.
To delete this package from the WMI repository on the distribution point, powershell is the quickest method:
Get-WMIObject -ComputerName "DPNAME" -Namespace "root\sccmdp" -Query ("Select * from SMS_PackagesInContLib where PackageID = 'PACKAGEID'") | Remove-WmiObject
Note: replace Distribution point name and package id.
To fix:
we have to login one of the distribution point or where you have access to read WMI
Open Powershell ISE Paste below script and replace name. execute query you will see result of:
$computername = "DISTRIBTIONPOINT FQDN"
$WMIPkgList = Get-WMIObject -NameSpace Root\SCCMDP -Computername $computername -Class SMS_PackagesInContLib | Select -ExpandProperty PackageID | Sort-Object
$Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computername)
$RegKey= $Reg.OpenSubKey("SOFTWARE\\Microsoft\\SMS\\DP")
$ContentLib = $RegKey.GetValue("ContentLibraryPath")
$PkgLibPath = ($ContentLib) + "\PkgLib"
$drive = $PkgLibPath.SubString(0,1)
$PkgLibPath = $PkgLibPath.Replace(($drive+":\"),("\\"+$computername+"\"+$drive+"$\"))
$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 Delete these items from WMI:
$PksinWMIButNotContentLib
Write-Host Delete .INI files of these packages from the PkgLib folder:
$PksinContentLibButNotWMI
You will see below result:
One we have result we have to delete above listed package ID by using below PowerShell.
Note: if you search above package id you will not find any where in console.
Remove package from wmi
$computername = "distribution point FQDN Name"
$Distribtuionpointname = $computername
$PackageID = "PackageID"
Get-WMIObject -ComputerName $Distribtuionpointname -Namespace “root\sccmdp” -query (“select * from sms_packageincontlib where packageID = '" + $packageID + "'") | remove-wmiobject
Note: some time we may get result delete.Ini from Contentlib
Write-Host Delete .INI files of these packages from the PkgLib folder:
Once you have performed above task you are done and when next distribution point will run content validation your problem get resolve.
Happy Learning!!!
Thanks®ards,
Haresh Hirani
Email: [email protected], [email protected]
Facebook https://www.facebook.com/Hiraniconfigmgr-120189361980772/
Follow us: https://www.linkedin.com/in/hiraniconfigmgr
Twitter: https://twitter.com/hiraniconfigmgr
X
2 Comments
Michael
02-09-2021 09:47 amI receive an error when executing this : $PksinContentLibButNotWMI Get-ChildItem : Cannot find path '\\MYSERVER.domain.com\D$\SCCMContentLib\PkgLib' because it does not exist. At line:13 char:16 + $PkgLibList = (Get-ChildItem $PkgLibPath | Select -ExpandProperty Nam ... + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (\\MYSERVER.d...ntentLib\PkgLib:String) [Get-ChildItem], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand Compare-Object : Cannot bind argument to parameter 'DifferenceObject' because it is null. At line:17 char:91 + ... ct -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassTh ... + ~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Compare-Object], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObjectCommand Compare-Object : Cannot bind argument to parameter 'DifferenceObject' because it is null. At line:19 char:91 + ... ct -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassTh ... + ~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Compare-Object], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObjectCommand Delete these items from WMI: Delete .INI files of these packages from the PkgLib folder:
Andy
19-08-2022 10:03 amThere's a typo: packageincontlib should be a plural: PackagesInContLib - packages not package. There are also typos in the variable name but as they're variables it's not too important. Using camelcase would make this easier to read.