As much as possible you can use Ansible for this. I don't have the playbooks ready. However, use OneAgent CLI (https://www.dynatrace.com/support/help/shortlink/oneagentctl#host-groups) to create and manage host groups.
Remember that you can set the host group at installation or change it using the CLI. There is no other option.
Not quite agree with you @radek_jasinski, you can filter the oneagent deployment (let's say by tag) and then switch on the check box for all the hosts and you are all set.
If you have a tool to run the CLI on 100 hosts go for it!
I understand it's much easier to edit via the web, just tick a checkbox. But the dynatrace version of the customer is very old. Therefore, only about 70 out of 200 devices can use that feature.
If using the CLI, it should take quite a long time. If you have a more convenient way, please suggest.