Add new machine to group

Hi there,

Basically what I’m looking for is if the automox api has any options to update an automox group with the machine you are currently on?

Scenario:
IT Images a machine, goes through their post install script(s) now they need to manually go into automox and add the new host to the proper group. What would be ideal is during a post install script that we can pull the hostname of the machine and use it to update what group the machine is in in automox. Would this be possible or do we currently have to have the host ID found in automox?

You’re in luck. We have the API option for now:
https://docs.automox.com/api/endpoints/modify-a-device

and we’re about to release a new version of the agent that will let you put the group parameter in the MSI so it will go right into the group you want as part of the install:

This would require that you know the device ID within automox correct? Trying to find a way to automate the process.

And would the group parameter be included in the linux installer as well?

Thanks

Yep, and you can quickly get the device IDs by filtering the recently added devices (or whatever filter you need) and then exporting to CSV. The first column has the device IDs. We also have a script here you could modify and replace the API call with a group change:

Not sure on the Linux version; let me find out and get back to you.

what about the amagent --setgrp command? Does this insinuate that I would be setting the group for the current machine running the amagent command from? I found some documentation on it, albeit limited. And it didn’t seem to work how I would have expected.

The --setgroup command should work too. That was broken earlier this year but it should be fixed now. Let me know if it isn’t working for you and I’ll get engineering to look into it.

One note on that, just running --setgrp won’t change it on the fly. That group param is used during install. You can stop the service, run --deregister then --setgrp and start it, and it will take the group.

3 Likes

Here’s the documentation on --setgrp
https://docs.automox.com/home/agent-installation/automox-agent-advanced-options#assigning-a-group-to-a-device

Let me know if anything in there is unclear or isn’t working the way the documentation specifies.

and I got confirmation that the new installer MSI group flag will only work with Windows (since MSI is a Windows installer format).

That’s a bummer that this is only happening for windows.

–setgrp or doing it via the API should work, so let me know if you need help with getting those working properly. I can have support work with you to make sure it’s doing what you need.