How to Remove ConfigMgr SCCM Orphan Packages from Child Sites. I just thought of sharing one of the TechNet discussions regarding removing Orphan Packages from the child sites.
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.
How to Remove ConfigMgr SCCM Orphan Packages from Child Sites
You won’t delete those packages from the 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 to 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 packages created on child
Anoop is Microsoft MVP! He is a Solution Architect in enterprise client management with more than 20 years of experience (calculation done in 2021) in IT. He is a blogger, Speaker, and Local User Group HTMD Community leader. His main focus is on Device Management technologies like SCCM 2012, Current Branch, and Intune. E writes about ConfigMgr, Windows 11, Windows 10, Azure AD, Microsoft Intune, Windows 365, AVD, etc…