Unable to uninstall Dynatrace OneAgent on Windows

Abstract

How to manually uninstall Dynatrace OneAgent on Windows hosts.

Problem

While trying to uninstall an old version of OneAgent on Windows you’re getting an MSI error 1603.

This generally happens if the old .msi package pertaining to the same old version has been removed or deleted from the machine. Windows installer requires the same MSI package to uninstall a product.

Troubleshooting steps

To solve this issue, you must find the exact installer from a different machine or request Dynatrace to provide it to you. Ensure that the version you’re requesting is supported at that moment, otherwise, it will require manual uninstallation from the machine.

If you do not have access to the MSI package yet, please manually uninstall OneAgent from the Windows host.
 
Follow the steps below with admin rights or get help from a local Windows administrator to execute the steps:

Manual uninstall of OneAgent in case of msi 1603 error:

In the command prompt, please run the following command to find IdentifyingNumber
>wmic product where name=‘Dynatrace OneAgent’ get IdentifyingNumber

Follow the steps below with admin rights or get help from a local Windows administrator to execute the steps:
After following the steps, in the last please remove all the registry entries with IdentifyingNumber

  1. Uninstall the agent (if uninstall does not work, see the manual cleanup procedure below)
  2. Reboot (to remove all the injected code)
  3. Delete the INSTALL_DIR and RUNTIME_DIR directories [1].
    Default INSTALL_DIR = C:\Program Files\dynatrace\oneagent
    Default RUNTIME_DIR = %PROGRAMDATA%\dynatrace\oneagent
  4. Delete the following subfolders in %APPDATA%:
    1. OneAgent
    2. ruxit (if present)
  5. Delete %SYSTEMDRIVE%\AI_RecycleBin (if present)
  6. Delete the following file: %SystemRoot%\System32\drivers\oneagentmon.sys
  7. Using pnputil.exe, delete driver from DriverStore
    1. Run pnputil.exe /enum-drivers
    2. Locate driver with the provider name Dynatrace LLC, note the “published name” (e.g. oem2.inf)
    3. Delete driver with pnputil.exe /delete-driver <published name>
  8. Delete the oneagentmon service:
    1. Run sc stop oneagentmon
    2. Run sc delete oneagentmon
    3. If deleting the service with sc.exe fails for whatever reason, you can manually delete the service’s registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\oneagentmon
      In case you delete the key manually, be sure to reboot the machine after the last step. Otherwise the service control manager will think the service still exists and re-creating it will fail if the machine is not rebooted in between.
  9. Remove WinPcap by running C:\Program Files\WinPcap\uninstall.exe (note that the OneAgent uninstaller removes WinPcap but keeps uninstall.exe, this step will remove that as well)
  10. Reboot (optional) - needed for Windows to delete registry keys for paths that were removed.

Resolution

Hopefully, you will be able to uninstall the old OneAgent version by following the manual uninstallation steps.

What’s next

However, if the steps provided did not work, please contact Product Specialist/Technical Support at Dynatrace, mention that this article was used, and provide the following in the ticket:

  • direct URL to the impacted host
  • version of the OneAgent installed on the host
  • what steps were performed
18 Likes

Been there, WILL do that, next time. I was like crazy looking for old packages in others hosts lol.

1 Like

This is very helpful! Thank you!

3 Likes

Thanks for sharing! Briliant!

1 Like

Hi,

For better results, it is advisable to run the following command in command prompt and get the identifying number:

wmic product where name=‘Dynatrace OneAgent’ get IdentifyingNumber

After following the steps, in the last please remove all the registry entries with IdentifyingNumber

Br/Nadeem

1 Like

Hi, assume same instructions today?

Yes, it should still work.