Thank you for posting your question in the Microsoft Q&A forum.
The “orphaned apps” alerts in SharePoint Server 2016 can be especially challenging to resolve, particularly when they stem from prior hardware or storage failures. Unfortunately, there isn’t a supported GUI option or PowerShell command that will reliably identify these issues.
In most cases, the Health Analyzer or standard enumeration tools don’t detect them, because from SharePoint’s perspective the apps no longer exist in the site map or structure. However, remnants of the app installations may still remain in the SQL content databases, typically in tables such as AppInstallations or AppInstances, which causes the alerts to persist.
Some users have managed to identify orphaned apps by querying the database directly. This method is reported in several community posts:
- 2013 - OrphanApp message in Health analyzer - SharePoint Stack Exchange.
- Orphaned App in content database in SharePoint 2019 - SharePoint Stack Exchange.
Note: Microsoft is providing this information as a convenience to you. These sites are not controlled by Microsoft, and Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please ensure that you fully understand the risks before using any suggestions from the above link.
It’s important to note that directly editing or deleting rows in SharePoint databases is not supported by Microsoft and carries significant risk. If you do explore this route, community guidance strongly recommends doing so only in a controlled environment, with full backups in place.
I hope this information is helpful.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.