Several customers of mine have come across SCOM agents that cannot be uninstalled. This can be triggered by uninstalling an agent manually or when you want to upgrade the agent to 2012. This can occur with SCOM 2007 RTM, SP1 or R2 agents. I haven’t come across this issue on SCOM 2012 yet, but you never know!
In this case, I wanted to uninstall an agent using add/remove programs:
When trying to uninstall the agent, I stumbled across the following issue:
The patch package could not be opened. Verify that the patch package exists and that you can access it, or contact the application vendor to verify this is a valid Windows Installer patch package.
What does this mean? You probably installed some agent patch on this server, may this be a seperate KB or a cumulative update. The problem is, when uninstalling the agent, the uninstaller looks where the install files for this cumulative update are located. To find out which patch was installed, open the registry editor regedit.exe.
If it is a SCOM 2007 pre-R2 agent, go to HKEY_CLASSES_ROOT\Installer\Products\C9A0067E2876122489E4BA987C08CDD2\Patches
If it is a SCOM 2007 R2 agent, go to: HKEY_CLASSES_ROOT\Installer\Products\7779052F1B26F94BAD9C107B86962A2\Patches
If it is a SCOM 2012 agent, go to: HKEY_CLASSES_ROOT\Installer\Products\9D603783EC87E0E49B25825AC08C3BEE\Patches
(thanks binaryoverflow.wordpress.com for pointing out the location for SCOM 2012!)
Open the Multi-String Patches. In my case, I saw the following 3 lines:
By removing the contents of this REG_MULTI_SZ:
I was able to uninstall the agent. Problem solved!
[EDIT 11-October-2012]I just discovered that Microsoft released a KB for this issue! http://support.microsoft.com/kb/971187%5B/edit%5D