Issue
In some environments, SQL Server services may still exist on the server, but the related SQL Server entries are missing from Programs and Features. This can happen due to missing or corrupted registry entries, incomplete uninstallations, or failed patching activities.
To identify the uninstall information from the registry, the following PowerShell script can be used:
Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*, `
HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
Where-Object { $_.DisplayName -like “*SQL Server 2016*” } |
Select-Object DisplayName, UninstallString
Solution
The above script helps retrieve the UninstallString for SQL Server components directly from the registry.
In many cases, the uninstall command may contain:
/I
For uninstallation, this should be replaced with:
/X
Example:
MsiExec.exe /x
This forces the uninstall operation instead of launching the installer in maintenance mode.
Important Remarks
- This approach should mainly be considered for remote support cases or emergency cleanup situations.
- There is always a possibility of future issues when manually cleaning up SQL Server components using registry-based uninstall methods.
- The recommended and safest approach is always to rebuild the server if SQL Server installation metadata or registry entries are heavily corrupted.
- Use this method only as a last resort and proceed at your own risk.
Summary
When SQL Server entries are missing from Programs and Features, the uninstall details can still be retrieved from the Windows registry using PowerShell. Replacing /I with /X in the uninstall command can help remove orphaned SQL Server components. However, since this method relies on registry-based cleanup, it should only be used cautiously in exceptional scenarios, with server rebuild remaining the preferred long-term solution.
Thank You,
Vivek Janakiraman
Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.




