Automox Script: Set Tags for All Computers in a Group
Automox Script Overview: Set Tags for All Computers in a Group
he 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 email@example.com.
About Automox Automated Patch Management
Facing growing threats and a rapidly expanding attack surface, understaffed and alert-fatigued organizations need more efficient ways to eliminate their exposure to vulnerabilities. Automox is a modern cyber hygiene platform that closes aperture of attack by more than 80% with just half the effort of traditional solutions.
Cloud-native and globally available, Automox enforces OS & third-party patch management, security configurations, and custom scripting across Windows, Mac, and Linux from a single intuitive console. IT and SecOps can quickly gain control and share visibility of on-prem, remote and virtual endpoints without the need to deploy costly infrastructure.
Experience modern, cloud-native patch management today with a 15-day free trial of Automox and start recapturing more than half the time you're currently spending on managing your attack surface. Automox dramatically reduces corporate risk while raising operational efficiency to deliver best-in-class security outcomes, faster and with fewer resources.