# Elastic Agent Unenrollment

**URL:** https://discuss.elastic.co/t/elastic-agent-unenrollment/266985
**Category:** Endpoint Security
**Tags:** fleet
**Created:** [March 11, 2021, 5:40pm UTC](https://discuss.elastic.co/t/elastic-agent-unenrollment/266985 "2021-03-11T17:40:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![The1WhoPrtNocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the1whoprtnocks/32/72685_2.png) [@The1WhoPrtNocks](https://discuss.elastic.co/u/The1WhoPrtNocks)
#### Post date: [March 11, 2021, 5:40pm UTC](https://discuss.elastic.co/t/elastic-agent-unenrollment/266985/1 "2021-03-11T17:40:01Z")

</div>

Hi,

I was wondering if there were plans as part of an Agent un-enrolment to disable the Elastic Agent service on the host and delete the C:\Program Files\Elastic directory?

As without doing that you can not re-enroll the endpoint using the agent.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![gabriel.landau](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel.landau/32/73401_2.png) [@gabriel.landau](https://discuss.elastic.co/u/gabriel.landau)
#### Post date: [March 16, 2021, 6:00pm UTC](https://discuss.elastic.co/t/elastic-agent-unenrollment/266985/2 "2021-03-16T18:00:23Z")

</div>

Hello @The1WhoPrtNocks . Thanks for reaching out. This is actually documented functionality right now: [Unenroll Elastic Agent | Fleet User Guide [7.11] | Elastic](https://www.elastic.co/guide/en/fleet/7.11/unenroll-elastic-agent.html)

> The agent will continue to run, but will not be able to send data. It will show this error instead: `invalid api key to authenticate with fleet` .

That being said, I can see how this behavior can be unintuitive. We filed a bug here: [[Agent] Elastic Agent Unenroll Action Leaves Dormant Service and Process Running · Issue #24568 · elastic/beats · GitHub](https://github.com/elastic/beats/issues/24568)

---

<div class="post-metadata">

### Author: ![The1WhoPrtNocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the1whoprtnocks/32/72685_2.png) [@The1WhoPrtNocks](https://discuss.elastic.co/u/The1WhoPrtNocks)
#### Post date: [April 1, 2021, 8:29am UTC](https://discuss.elastic.co/t/elastic-agent-unenrollment/266985/3 "2021-04-01T08:29:09Z")

</div>

Hi @gabriel.landau ,

Thanks for the info and creating the bug post.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 29, 2021, 8:29am UTC](https://discuss.elastic.co/t/elastic-agent-unenrollment/266985/4 "2021-04-29T08:29:13Z")

</div>

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