How Do I Move a Device from One Organization to Another?

Follow

Sometimes, it may be desirable to move a device from one organization to another in the Automox console. This can be accomplished in two steps that can either be performed on the target server, or through the use of a custom patch policy if updating a large number of servers.

 

Manual

Manually moving a device to a new organization requires running just two commands directly on the target server.

Update Agent Key

To move a device from one organization to another, you first must update the access key the Automox agent is using to the target organization. This can be done with the help of the --setkey option.

macOS

sudo /usr/local/bin/amagent --setkey <NEW_ORGANIZATION_ACCESS_KEY>

Windows

C:\Program Files (x86)\Automox\amagent.exe --setkey <NEW_ORGANIZATION_ACCESS_KEY>

Linux

sudo /opt/amagent/amagent --setkey <NEW_ORGANIZATION_ACCESS_KEY>

Deregister the Agent

Next, you must deregister the Automox agent from the organization it is currently associated with using the --deregister option.

macOS

sudo /usr/local/bin/amagent --deregister

Windows

C:\Program Files (x86)\Automox\amagent.exe --deregister

Linux

sudo /opt/amagent/amagent --deregister

 

Automatic

If moving a large number of servers from one organization to another, it may be preferable to create a Custom Patch Policy to automatically execute the above steps on the target servers.

Evaluation

Because custom patch policies are only run when remediation is required, it is necessary to create an intentionally failing policy evaluation. This can be accomplished by returning with a non-zero exit code in the evaluation script.

macOS

#!/bin/bash
exit 1

Windows

Exit 1

Linux

#!/bin/bash
exit 1

Remediation

With a failed evaluation, the custom patch policy will then attempt to run the policy's remediation step during the scheduled policy time. Using the two manual steps outlined above, the remediation script must first set the new organization access key, and then deregister the agent from the existing organization.

macOS

#!/bin/bash
/usr/local/bin/amagent --setkey <NEW_ORGANIZATION_ACCESS_KEY>
/usr/local/bin/amagent --deregister

Windows

& "C:\Program Files (x86)\Automox\amagent.exe" --setkey <NEW_ORGANIZATION_ACCESS_KEY>
& "C:\Program Files (x86)\Automox\amagent.exe" --deregister

Linux

#!/bin/bash
/opt/amagent/amagent --setkey <NEW_ORGANIZATION_ACCESS_KEY>
/opt/amagent/amagent --deregister

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.