# Is it possible to reconnect to an Agent after uninstalling the Elastic Agent service?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-reconnect-to-an-agent-after-uninstalling-the-elastic-agent-service/328273>\
**Category:** Elastic Agent\
**Created:** [March 22, 2023, 4:45pm UTC](https://discuss.elastic.co/t/is-it-possible-to-reconnect-to-an-agent-after-uninstalling-the-elastic-agent-service/328273 "2023-03-22T16:45:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kreed](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@kreed](https://discuss.elastic.co/u/kreed)\
**Post date:** [March 22, 2023, 4:45pm UTC](https://discuss.elastic.co/t/is-it-possible-to-reconnect-to-an-agent-after-uninstalling-the-elastic-agent-service/328273/1 "2023-03-22T16:45:49Z")

</div>

I am new the Elastic so this question may be trivial. For some background, I am working on an application that monitors the status of the Elastic Agent Windows service. I want this app to be able to uninstall and re-install the Elastic Agent Service. As of now, I am installing/reinstalling a Fleet Agent, but eventually I want to use this app with enrolling individual agents into a fleet. When the service is uninstalled from a computer, I see a status of "Offline" for that agent, which makes sense. However when I go to reinstall the service, using the same credentials I had previously (fleet service token, fleet server policy, and trusted fingerprint), it creates a brand new Fleet Agent in Elastic instead of having the previous Fleet Fgent come back to a status of online. Is it possible to reconnect to the previous fleet agent after reinstalling the service? Will I see this same issue with using individual agents after uninstalling and reinstalling the Elastic Agent service?

---

<div class="post-metadata">

**Author:** ![kreed](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@kreed](https://discuss.elastic.co/u/kreed)\
**Post date:** [March 28, 2023, 6:26pm UTC](https://discuss.elastic.co/t/is-it-possible-to-reconnect-to-an-agent-after-uninstalling-the-elastic-agent-service/328273/2 "2023-03-28T18:26:38Z")

</div>

It's been a few days without a reply. Was wondering if I could get some assistance with this. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![kreed](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@kreed](https://discuss.elastic.co/u/kreed)\
**Post date:** [April 4, 2023, 5:18pm UTC](https://discuss.elastic.co/t/is-it-possible-to-reconnect-to-an-agent-after-uninstalling-the-elastic-agent-service/328273/3 "2023-04-04T17:18:52Z")

</div>

Bumping this thread again. Still looking for help. Thanks!

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [April 4, 2023, 5:27pm UTC](https://discuss.elastic.co/t/is-it-possible-to-reconnect-to-an-agent-after-uninstalling-the-elastic-agent-service/328273/4 "2023-04-04T17:27:46Z")

</div>

> [@kreed](#):
>
> However when I go to reinstall the service, using the same credentials I had previously (fleet service token, fleet server policy, and trusted fingerprint), it creates a brand new Fleet Agent in Elastic instead of having the previous Fleet Fgent come back to a status of online. Is it possible to reconnect to the previous fleet agent after reinstalling the service?

I don't think this is possible, when you install an agent it will create a new random agent id, so if you install it, uninstall and install again, a new randoum agent id will be generated.

---

<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:** [May 2, 2023, 5:28pm UTC](https://discuss.elastic.co/t/is-it-possible-to-reconnect-to-an-agent-after-uninstalling-the-elastic-agent-service/328273/5 "2023-05-02T17:28:31Z")

</div>

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