# OneAgent communication auto-update

**URL:** <https://community.dynatrace.com/t/oneagent-communication-auto-update/36543>\
**Category:** Dynatrace Managed\
**Tags:** installation, updates, dynatrace-managed, oneagent\
**Created:** [September 15, 2022, 7:29am UTC](https://community.dynatrace.com/t/oneagent-communication-auto-update/36543 "2022-09-15T07:29:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![urs\_fischer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/urs_fischer/32/7896_2.png) [@urs\_fischer](https://community.dynatrace.com/u/urs_fischer)\
**Post date:** [September 15, 2022, 7:29am UTC](https://community.dynatrace.com/t/oneagent-communication-auto-update/36543/1 "2022-09-15T07:29:49Z")

</div>

Hello Community,

An agent from Environment A was downloaded and installed on servers that should actually be in Environment B. Now I have seen that you can change the environment via oneagentctl.exe:  
--set-tenant and --set-tenant-token

Since the cluster nodes are the same for Environment A and Environment B, they should still be accessible when changing the environment (we have of course other Environment ActiveGates for A and B but the same Cluster nodes). So, my thought is to use these two options from oneagentctl to change the environment. This then looks something like this:  
.\oneagentctl.exe --set-tenant=TENANT-B --set-tenant-token=TENANTTOKENOFB --restart-service

After this is run, does it automatically also Update the configuration for the ActiveGates so that those of the Environment will take place? I thought that because the cluster nodes are the same, it will probably update those automatically?

For my understanding, it should somehow update it because if I add an extra ActiveGate to an Environment, this should also be deployed to the existing OneAgents… or are I wrong?

Greetings, Urs

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [September 16, 2022, 7:14am UTC](https://community.dynatrace.com/t/oneagent-communication-auto-update/36543/2 "2022-09-16T07:14:02Z")

</div>

If the OneAgent has access to the cluster nodes, or Cluster ActiveGate (if deployed), it will update the configuration. If you environment disallows such connections and oneagents can only connect using the Environmnet ActiveGates, then you must also set the endpoint using --set-server to a valid address for the B environment.

The endpoints are updated as soon as the OneAgent connects to the environment.
