Troubleshooting SCCM 2012 SP1 Patch Download Failures: WMI Namespace Conflicts and Error 0x80041013


2 views

When Automatic Deployment Rules (ADRs) fail with error 0X87D20417 in SCCM 2012 SP1, the root cause often lies deeper in the WMI infrastructure. The key smoking gun appears in PatchDownloader.log:

GetContentFileInfoForDownload() failed for ContentID 16821994. hRes = 0x80041013
ERROR: DownloadContentFiles() failed with hr=0x80041013

The error cascade reveals an important pattern:

  • Console error: 0X87D20417 (Auto Deployment Rule Download failed)
  • SMS_RULE_ENGINE: Error 8706 (Content download failed)
  • ruleengine.log: Error code 4115 (Failed to download from internet)
  • PatchDownloader.log: 0x80041013 (WMI provider load failure)

The critical finding was the incorrect WMI namespace reference:

Trying to connect to the \\\\SCCM.ad.example.com\\root\\sms\\site_REV namespace

When it should be connecting to:

\\\\SCCM.ad.example.com\\root\\sms\\site_004

To locate potential configuration remnants, these SQL queries can help identify rogue site references:

-- Check for any configuration referencing the wrong site code
SELECT * FROM SysResList WHERE SiteCode LIKE '%REV%';

-- Verify active site control data
SELECT * FROM SiteControl WHERE SiteCode = '004';

-- Check package servers configuration
SELECT * FROM PkgServers WHERE sitecode != '004';

To properly fix the WMI namespace conflict:

  1. Stop the SMS_EXECUTIVE service
  2. Run this PowerShell command to verify the SMS Provider:
Get-WmiObject -Namespace "root\sms" -Class "SMS_ProviderLocation" | 
Where-Object { $_.ProviderForLocalSite -eq $true } | 
Select-Object Machine, NamespacePath

If incorrect, update the provider location:

$provider = Get-WmiObject -Namespace "root\sms" -Class "SMS_ProviderLocation" |
Where-Object { $_.ProviderForLocalSite -eq $true }

$provider.NamespacePath = "\\\\SCCM.ad.example.com\\root\\sms\\site_004"
$provider.Put() | Out-Null

For complete cleanup of the rogue namespace:

# Backup existing WMI configuration first
mofcomp -check backup.mof

# Delete the problematic namespace (if confirmed safe)
$ns = [wmiclass]"\\SCCM.ad.example.com\root\sms:__namespace"
$ns.psbase.Delete("site_REV")

After making changes, verify the fix by:

  1. Triggering a manual ADR evaluation
  2. Monitoring PatchDownloader.log for correct namespace usage
  3. Checking that content downloads complete successfully

Always test in a non-production environment first when making WMI namespace modifications.


When Automatic Deployment Rules (ADRs) fail with error code 0X87D20417 in SCCM 2012 SP1, the underlying issue often traces back to WMI namespace conflicts. The key smoking gun appears in PatchDownloader.log:

ERROR: DownloadContentFiles() failed with hr=0x80041013
GetContentFileInfoForDownload() failed for ContentID 16821994. hRes = 0x80041013

First verify the expected WMI namespace structure using PowerShell:

# Check current site namespace
$SiteCode = (Get-WmiObject -Namespace "root\SMS" -Class SMS_ProviderLocation).SiteCode
Get-WmiObject -Namespace "root\SMS\site_$SiteCode" -List | Measure-Object

Compare this against the problematic namespace reference found in logs (site_REV). The mismatch indicates either:

  • Legacy namespace remnants from migration
  • Corrupted WMI provider registration

Search for orphaned site references in the SCCM database:

-- Check for any site code anomalies
SELECT SiteNumber, SiteCode, ServerName, Type 
FROM dbo.System_DISC
WHERE SiteCode NOT IN (SELECT SiteCode FROM dbo.Sites)

When facing WMI provider load failures (0x80041013), follow this repair sequence:

# Step 1: Re-register WMI providers
cd %windir%\System32\wbem
for /f %s in ('dir /b /s *.dll') do regsvr32 /s %s

# Step 2: Reset WMI repository (backup first)
net stop winmgmt
ren Repository Repository.old
net start winmgmt

For persistent namespace issues, manually clean conflicting references:

# Remove orphaned namespace (use with caution)
$namespace = "root\SMS\site_REV"
if (Test-Path "HKLM:\SOFTWARE\Microsoft\WBEM\CIMOM\Autorecover MOFs\$namespace") {
    Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\WBEM\CIMOM\Autorecover MOFs\$namespace" -Force
}

Confirm successful repair by:

  1. Monitoring PatchDownloader.log for correct namespace connections
  2. Verifying WMI queries return proper site code:
Get-WmiObject -Query "SELECT * FROM SMS_SCI_SiteDefinition" -Namespace "root\SMS\site_$SiteCode"