Content validation issues in SCCM 2012

Sometimes, 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 “Failed to validate content hash”.

Then something along the lines 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.”

So far it all sounds easy, and when we look at 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

Replace DPNAME with the FQDN of your distribution point, and PACKAGEID with the ID of the package you found in smsdpmon.log. Finally, resend the package to the DP (‘redistribute’ button in the content tab of the DP)

edit/update 1
You may also encounter this error in the smsdpmon.log:

CContentDefinition::CheckFiles failed; 0x80070003
Failed to evaluate package XX100XXX, Error code 0x80070003

0x80070003 means file not found. I didn’t figure out why this is happening, because I could see all required files in the content library on the DP. The package that had this error had been prestaged, and there had been several updates, likely some discrepancy causes the validation to fail.
First, connect to the DP’s content library (\\dpname\sccmcontentlib$\). Check for a .ini file with the package name in the PkgLib folder. Delete it.

Then run the WMI-remove command as specified above and resend the package to the DP (‘redistribute’ button in the content tab of the DP)

edit/update 2
If your DP runs a content validation and discovers missing files, it’ll show something like this in the distribution point configuration status:
Status Type: Error
Message: One or more files are missing
Description:
Following file(s) of package “xxx” on distribution point XXX are missed.

If you’re sure the source package on your site server is correct, you can simply remove the WMI entry on the DP and remove the .ini file in the PkgLib folder on the DP and redistribute the package to the DP to have the next validation run without errors.

Extra script to find and correct WMI/PkgLib issues:
You can view any discrepancies between the WMI database and the PkgLib folder by running this Powershell script on the DP:

$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 Delete these items from WMI:
$PksinWMIButNotContentLib

Write-Host Delete .INI files of these packages from the PkgLib folder:
$PksinContentLibButNotWMI

Don’t forget to redistribute and rerun validation after distribution is complete.

Edit 3:

A customer requested a version of this script that works remotely, below code will remotely check which package mismatches exist between the Content library and WMI on your Distribution Point:

 

 

$computername = "FQDN.OF.DISTRIBTIONPOINT" 

$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

Leave a Reply

7 Comments on "Content validation issues in SCCM 2012"

Notify of
avatar
Sort by:   newest | oldest | most voted
Andrew Blunt
Guest

I had a problem that sounds very similar. For me, only Packages were affected. I fixed it by removing the content from all DPs, remove the source directory in the package settings then click OK. Wait for the content to be removed from the primary site (see distmgr.log), then re-add the source directory setting and distribute to the DPs.

Jose
Guest

I ran the above script and I’m still seeing the yellow yield sign after refreshing the DP.

chatski
Guest

Thanks a million!

Tony Salter
Guest
Fantastic work – took a while to find your post, all others did not work for me… they mention file permissions etc but it didnt make sense all other dp’s get the distribution and all other content makes it fo this DP with the errors for this app. I followed your instructions exactly and all that was different for me was this. Trying to delete the .ini file in PkgLib folder for my application was an issue – i got access denied error. Instead of going off and investigating the security on that file i just rebooted the DP and… Read more »
trackback

[…] scripts which I start on the effected distribution points. These are found on TechNet Gallery and Liebensraum (extra […]

wpDiscuz