How do you uninstall an Elastic Agent?

My computer crashed while I was installing an elastic agent. So I rebooted and tried again, but the elastic-agent.exe install ...etc... gave an error say it is unabel to, and that i need to uninstall it first. So then I ran this command:

PS C:\Program Files\Elastic\Agent> .\elastic-agent.exe uninstall
Elastic Agent will be uninstalled from your system at C:\Program Files\Elastic\Agent. Do you want to continue? [Y/n]:Y

I've waited several hours and there's no response from the command. I rebooted my computer and tried the uninstall command again . Again it just stays stuck on that screen. I waited a few more hours but still no response.

How do I uninstall an Elastic Agent?

Hello @learningelastic,

Because Elastic Agent is installed as an auto-starting service, it will restart automatically if the system is rebooted. So, what is the status of your agent? elastic-agent status logs: C:\Program Files\Elastic\Agent\data\elastic-agent-*\logs\

If any Elastic Agent-related processes are still running, stop them and then try running the following commands:

cd %TEMP%
copy "c:\Program Files\Elastic\Endpoint\elastic-endpoint.exe" elastic-endpoint.exe
.\elastic-endpoint.exe uninstall
del .\elastic-endpoint.exe

Hope this helps but I would also check this link: troubleshoot common problems.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.