# Updating hostgroup information in many hostst.

**URL:** <https://community.dynatrace.com/t/updating-hostgroup-information-in-many-hostst/39690>\
**Category:** Open Q&A\
**Tags:** hosts-classic\
**Created:** [May 11, 2023, 12:51pm UTC](https://community.dynatrace.com/t/updating-hostgroup-information-in-many-hostst/39690 "2023-05-11T12:51:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexrp25](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@alexrp25](https://community.dynatrace.com/u/alexrp25)\
**Post date:** [May 11, 2023, 12:51pm UTC](https://community.dynatrace.com/t/updating-hostgroup-information-in-many-hostst/39690/1 "2023-05-11T12:51:16Z")

</div>

Hello, I would like to know if there is a way to update HOSTGROUP information in a way of script to many hosts. The hosts were never assigned any hostgroup. Is there a way to updated it using some kind of script?

Thanks.

---

<div class="post-metadata">

**Author:** ![D\_Miller](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/d_miller/32/22229_2.png) [@D\_Miller](https://community.dynatrace.com/u/D_Miller)\
**Post date:** [May 11, 2023, 12:57pm UTC](https://community.dynatrace.com/t/updating-hostgroup-information-in-many-hostst/39690/2 "2023-05-11T12:57:35Z")

</div>

Hello,

Yes it can be done using the APIs or even via the options in Manage \> Deployment Status page

---

<div class="post-metadata">

**Author:** ![Mohamed\_Hamdy](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Mohamed\_Hamdy](https://community.dynatrace.com/u/Mohamed_Hamdy)\
**Post date:** [May 11, 2023, 1:05pm UTC](https://community.dynatrace.com/t/updating-hostgroup-information-in-many-hostst/39690/3 "2023-05-11T13:05:38Z")

</div>

Hello&nbsp;[@alexrp25](https://community.dynatrace.com/user/53629),

there are multiple ways to do that,

[Host group API](https://www.dynatrace.com/support/help/shortlink/api-config-oneagent-on-host-group)

Or you can add the hosts to an existing host group or add a new host group using UI

 ![Mohamed_Hamdy_1-1683810236846.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/f/efec9fb6028741eba362594ee7571d46b2297152.png)

 ![Mohamed_Hamdy_0-1683810202238.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/4c8ae936d563b9c6d1cf69ae99e836b288158e80.png)

Deployment Status - Select the required hosts - select modify host group from the remote configuration list - and choose the required hostgroup

Or to use oneagentctl but you have to access the servers where oneagent is installed and execute the command

> **[OneAgent configuration via command-line interface](https://docs.dynatrace.com/docs/ingest-from/dynatrace-oneagent/oneagent-configuration-via-command-line-interface)**
>
> Learn how to perform some OneAgent configuration tasks without the need to reinstall OneAgent.

don’t forget to add --restart-service
