Upgraded SCCM Distribution Point and SCCMDP namespace is missing

I upgraded a lab distribution point (not in production) from Windows Server 2012 R2 to Windows Server 2019 and for some reason, the SCCMDP namespace in WMI was missing.  I was able to recreate it by mofcomping the smsdpprov.mof, but then all the instances of the package information were missing.  I queried the database and used the results to build a powershell script to add back all the instances (ran locally on the distribution point):

declare @ServerName varchar (50) = 'SERVERNAME.DOMAIN'

select
  dp.PackageID
, case
 when p.ShareName <> ''
  then '\\' + @ServerName + '\' + p.ShareName
 else ''
  end ShareName
, 'Set-WmiInstance -Path ''ROOT\SCCMDP:SMS_PackagesInContLib'' -Arguments @{PackageID="'
  + dp.PackageID + '";PackageShareLocation="' +
 case
  when p.ShareName <> ''
   then '\\' + @ServerName + '\' + p.ShareName
  else ''
   end + '"}' PowershellCommand
from v_DistributionPoint dp
inner join v_Package p on p.PackageID = dp.PackageID
where dp.ServerNALPath like '[[]"Display=\\' + @ServerName + '%'

Alternatively, to delete an instance:

Get-WmiObject -Class SMS_PackagesInContLib -ComputerName SERVERNAME.DOMAIN -Filter "PackageID='001015F2'" -Namespace ROOT\SCCMDP | Remove-WmiObject

4 thoughts on “Upgraded SCCM Distribution Point and SCCMDP namespace is missing

  1. Been fighting with this bloody issue for months. Sometimes you need to redistribute everything, sometimes that doesn’t work so you have to remove content and redistribute it

    Going to try this today and see if it helps.

    Like

    1. Confirmed working! THANK YOU! I’ve been uninstalling and re-installing the DP role and having to redistribute content due to hash mismatches. Just re-populating the WMI namespace using this little beauty means no more of that. Now I can finally upgrade the remaining DPs without having to wait days for content replication.

      I owe you a beer

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s