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

Sharing is caring!

2 thoughts on “How to Remove ConfigMgr SCCM Orphan Packages from Child Sites”

  1. 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.