# Unenrollment on already offline hosts

**URL:** <https://discuss.elastic.co/t/unenrollment-on-already-offline-hosts/376631>\
**Category:** Elastic Agent\
**Created:** [April 1, 2025, 10:16am UTC](https://discuss.elastic.co/t/unenrollment-on-already-offline-hosts/376631 "2025-04-01T10:16:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ziyi26](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@Ziyi26](https://discuss.elastic.co/u/Ziyi26)\
**Post date:** [April 1, 2025, 10:16am UTC](https://discuss.elastic.co/t/unenrollment-on-already-offline-hosts/376631/1 "2025-04-01T10:16:41Z")

</div>

Hi there,

We have a lot of Offline Elastic Agents on hosts which have not checked in for over 6 months. Per documentation, the enrollment-timeout should take care of this by automatically unenroll them and set them as inactive. However, since these hosts have not connected over 6 months, will Fleet still unenroll them based on their last activity timer or does fleet require it to check in again and then expire?

See related documentation:

> **[Set unenrollment timeout for ephemeral hosts | Fleet and Elastic Agent Guide...](https://www.elastic.co/guide/en/fleet/8.6/set-enrollment-timeout.html)**

Thanks,

Ziyi

---

<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 1, 2025, 12:38pm UTC](https://discuss.elastic.co/t/unenrollment-on-already-offline-hosts/376631/2 "2025-04-01T12:38:00Z")

</div>

On which version are you?

This setting was deprecated on 8.7.0 and didn't work if the Fleet Server version was 8.7.0 or higher than that.

> An optional timeout in seconds. **If provided, and fleet server is below version 8.7.0** , an agent will automatically unenroll after being gone for this period of time.

But it also came back in later versions, not exactly which one, but something between 8.15.2 and 8.17.3.

On 8.17.3 I have this:

> **Inactive agent unenrollment timeout**  
> An optional timeout in seconds. If configured, inactive agents will be automatically unenrolled and their API keys will be invalidated after they've been inactive for this value in seconds. This can be useful for policies containing ephemeral agents, such as those in a Docker or Kubernetes environment.

---

<div class="post-metadata">

**Author:** ![Ziyi26](https://avatars.discourse-cdn.com/v4/letter/z/a698b9/32.png) [@Ziyi26](https://discuss.elastic.co/u/Ziyi26)\
**Post date:** [April 2, 2025, 11:20am UTC](https://discuss.elastic.co/t/unenrollment-on-already-offline-hosts/376631/3 "2025-04-02T11:20:06Z")

</div>

Hi Leandro,

I am on 8.16.3 and its similar to your 8.17.3. So will setting:

1. An inactivity timeout move agents to inactive after some time offline
2. An unenroll timeout move agents to unenroll after some time inactive

I expect that this also work for agent already passed both timeouts in retro by using their last checkin timer, right?
