How to Remove ConfigMgr SCCM Orphan Packages from Child Sites

Just thought of sharing one of the TechNet discussion regarding the removal Orphan Packages from the child sites.

Original Post

Packages that are deleted at a parent site can be orphaned at a child site if the child site is down at the time of deletion (temporarily), or the replication process is unsuccessful. You won’t be able to delete those packages from child site because they appear as “locked” in the console. In this case, we will need to manually fix the problem by modifying the package record from the child site database, so that we will be allowed to delete the package from the child site console.

Steps to Remove Orphan Packages

To remove orphan packages from the
SQL Server database, use the following steps:

1. Open SQL Server Management Studio, and use the site database of the child site cs1(SMS_cs1).

2. Type and run the following command in the query window:

select PkgId, Name, SourceSite from SMSPackages

3. Search for the PkgID file that you want to remove.

You should be able to find this
package in the result of this query. If the PkgID is not found, it shouldn’t
have been displayed in the cs1 console in the first place – close and re-open
the cs1 SCCM console if this is the case.

4. Type and run the following command in the query window:

Update SMSPackages Set SourceSite=’cs1′ Where PkgID= ”

5. The package is now set to a local package and you can delete it from within the SCCM Administrator console.

Please delete it from the cs1 console, and then the deletion will be gracefully
replicated to all sites below cs1 as if it were a packages created on child

About Author 

Anoop is Microsoft MVP and Veeam Vanguard ! He is a Solution Architect on enterprise client management with more than 13 years of experience (calculation done on the year 2014) in IT. He is Blogger, Speaker and Local User Group Community leader. His main focus is on Device Management technologies like SCCM 2012,Current Branch, Intune. He writes about the technologies like SCCM, SCOM, Windows 10, Azure AD, Microsoft Intune, RMS, Hyper-V etc...

    Find more about me on:
  • googleplus
  • twitter
  • facebook
  • linkedin
  • youtube
Posted in: ConfigMgr (SCCM)


  1. Rick says:

    How would I remove drivers that got imported but then the sql database got restored to a time before they were imported, now it wont reimport them? how do i clean up orphaned invisible drivers?

Leave a Comment and Contact Anoop