{"id":27,"date":"2014-09-10T14:05:11","date_gmt":"2014-09-10T14:05:11","guid":{"rendered":"https:\/\/www.lieben.nu\/liebensraum\/?p=27"},"modified":"2014-09-10T14:05:11","modified_gmt":"2014-09-10T14:05:11","slug":"content-validation-issues-in-sccm-2012","status":"publish","type":"post","link":"https:\/\/lieben.nu\/liebensraum\/2014\/09\/content-validation-issues-in-sccm-2012\/","title":{"rendered":"Content validation issues in SCCM 2012"},"content":{"rendered":"<p>Sometimes, distribution points have packages in their WMI repository that don&#8217;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 &#8216;Warning&#8217;.<\/p>\n<p>The error you&#8217;ll see in the Distribution Point Configuration Status overview is &#8220;Failed to validate content hash&#8221;.<\/p>\n<p>Then something along the lines of &#8220;Failed to retrieve the package list on the distribution point. Or the package list in content library doesn&#8217;t match the one in WMI. Review smsdpmon.log for more information about this failure.&#8221;<\/p>\n<p>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&#8217;t exist.<\/p>\n<p>To delete this package from the WMI repository <!--more-->on the distribution point, powershell is the quickest method:<\/p>\n<blockquote>\n<pre>Get-WMIObject -ComputerName \"DPNAME\" -Namespace \"root\\sccmdp\" -Query (\"Select * from SMS_PackagesInContLib where PackageID = 'PACKAGEID'\") | Remove-WmiObject<\/pre>\n<\/blockquote>\n<p>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 (&#8216;redistribute&#8217; button in the content tab of the DP)<\/p>\n<p><strong>edit\/update 1<\/strong><br \/>\nYou may also encounter this error in the smsdpmon.log:<\/p>\n<pre>CContentDefinition::CheckFiles failed; 0x80070003\nFailed to evaluate package XX100XXX, Error code 0x80070003\n<\/pre>\n<p>0x80070003 means file not found. I didn&#8217;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.<br \/>\nFirst, connect to the DP&#8217;s content library (\\\\dpname\\sccmcontentlib$\\). Check for a .ini file with the package name in the PkgLib folder. Delete it.<\/p>\n<p>Then run the WMI-remove command as specified above and resend the package to the DP (&#8216;redistribute&#8217; button in the content tab of the DP)<\/p>\n<p><strong>edit\/update 2<\/strong><br \/>\nIf your DP runs a content validation and discovers missing files, it&#8217;ll show something like this in the distribution point configuration status:<br \/>\nStatus Type: Error<br \/>\nMessage: One or more files are missing<br \/>\nDescription:<br \/>\nFollowing file(s) of package &#8220;xxx&#8221; on distribution point XXX are missed.<\/p>\n<p>If you&#8217;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.<\/p>\n<p><strong>Extra script to find and correct WMI\/PkgLib issues:<\/strong><br \/>\nYou can view any discrepancies between the WMI database and the PkgLib folder by running this Powershell script on the DP:<\/p>\n<pre>$WMIPkgList = Get-WmiObject -Namespace Root\\SCCMDP -Class SMS_PackagesInContLib | Select -ExpandProperty PackageID | Sort-Object\n\n$ContentLib = (Get-ItemProperty -path HKLM:SOFTWARE\\Microsoft\\SMS\\DP -Name ContentLibraryPath)\n\n$PkgLibPath = ($ContentLib.ContentLibraryPath) + \"\\PkgLib\"\n\n$PkgLibList = (Get-ChildItem $PkgLibPath | Select -ExpandProperty Name | Sort-Object)\n\n$PkgLibList = ($PKgLibList | ForEach-Object {$_.replace(\".INI\",\"\")})\n\n$PksinWMIButNotContentLib = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq \"&lt;=\" } \n\n$PksinContentLibButNotWMI = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq \"=&gt;\" } \n\nWrite-Host Delete these items from WMI:\n$PksinWMIButNotContentLib\n\nWrite-Host Delete .INI files of these packages from the PkgLib folder:\n$PksinContentLibButNotWMI\n<\/pre>\n<p>Don&#8217;t forget to redistribute and rerun validation after distribution is complete.<\/p>\n<p><strong>Edit 3:<\/strong><\/p>\n<p>A customer requested a version of this script that works remotely, below code will remotely check which\u00a0package mismatches exist\u00a0between the Content library and WMI on your Distribution Point:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<pre>\n$computername = \"FQDN.OF.DISTRIBTIONPOINT\" \n\n$WMIPkgList = Get-WMIObject -NameSpace Root\\SCCMDP -Computername $computername -Class SMS_PackagesInContLib | Select -ExpandProperty PackageID | Sort-Object\n\n$Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computername)\n$RegKey= $Reg.OpenSubKey(\"SOFTWARE\\\\Microsoft\\\\SMS\\\\DP\")\n$ContentLib = $RegKey.GetValue(\"ContentLibraryPath\")\n\n$PkgLibPath = ($ContentLib) + \"\\PkgLib\"\n$drive = $PkgLibPath.SubString(0,1)\n$PkgLibPath = $PkgLibPath.Replace(($drive+\":\\\"),(\"\\\\\"+$computername+\"\\\"+$drive+\"$\\\"))\n\n$PkgLibList = (Get-ChildItem $PkgLibPath | Select -ExpandProperty Name | Sort-Object)\n\n$PkgLibList = ($PKgLibList | ForEach-Object {$_.replace(\".INI\",\"\")})\n\n$PksinWMIButNotContentLib = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq \"<=\" } \n\n$PksinContentLibButNotWMI = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq \"=>\" } \n\nWrite-Host Delete these items from WMI:\n$PksinWMIButNotContentLib\n\nWrite-Host Delete .INI files of these packages from the PkgLib folder:\n$PksinContentLibButNotWMI\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, distribution points have packages in their WMI repository that don&#8217;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 &#8216;Warning&#8217;. The error you&#8217;ll see in the Distribution Point Configuration Status overview is &#8220;Failed to validate content hash&#8221;. Then &hellip; <a href=\"https:\/\/lieben.nu\/liebensraum\/2014\/09\/content-validation-issues-in-sccm-2012\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Content validation issues in SCCM 2012<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[42],"tags":[],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-sccm2012"],"_links":{"self":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":0,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"wp:attachment":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}