Automox Script: Set Tags for All Computers in a Group

Automox Script Overview: Set tags for all computers in a group

The purpose of this Windows PowerShell script is to set the tags for all computers in a group. These tags override any tags that are currently assigned to any of those systems.

To run this script, use the code located here in the original posting on the Automox community. Please note the areas in the code that you will need to update to get the Worklet to run properly on your systems.

  • $orgID = 'YOUR_ORG_ID' - Put your Org ID, which can be found by looking at the URL of your console and selecting the value after the “?o=”: https://console.automox.com/dashboard?o=999999 . In this example URL, the Org ID is the 999999 portion.
  • $apiKey = 'YOUR_API_KEY' - In your console, go to Settings > API and select the API key. Note that the API key is per admin user, so you and another admin in your console will have different API keys.
  • $grpID = 'GROUP_ID_OF_SYSTEMS_TO_TAG' - Put your Group ID of the systems you want to set the tags on. It can be found by viewing the group page that lists devices in that particular group and grabbing the value after “gid=” in the URL. One way to get to that page is to go to the System Management page, then find the group that contains the systems you want to have tagged and click the little computer icon with a number under it. In this example, the group ID is 99999: https://console.automox.com/group-editor?frompage=devices&gid=99999&o=1234 1.
  • $tag = - Set the name for the tag you want on all of the systems. For multiple tags, you’ll just create additional tag variables such as $tag2, $tag3, etc. For multiple tags, you’ll also need to modify the tag section in the body of the code so that it has the list of tags you want. For example, "tags": [ "$tag", "$tag2" ], or "tags": [ "$tag", "$tag2", "$tag3" ], and so on.

Tips for running this Automox script

Before deploying this script to the production environment, we suggest testing this on a few devices to confirm its accuracy. If you have any questions, please contact our support team for technical assistance at support@automox.com.

Automox for Easy IT Operations

Automox is the cloud-native IT operations platform for modern organizations. It makes it easy to keep every endpoint automatically configured, patched, and secured – anywhere in the world. With the push of a button, IT admins can fix critical vulnerabilities faster, slash cost and complexity, and win back hours in their day. 

Grab your free trial of Automox and join thousands of companies transforming IT operations into a strategic business driver.