Windows
View all Worklets
WindowsWindows

Windows - Maintenance Tasks - Create WSUS Computer Target Groups

Automate creation of WSUS computer target groups on Windows Server endpoints

Worklet Details

What the WSUS computer group automation does

This Automox Worklet™ creates computer target groups on a WSUS server through automated PowerShell execution. The Worklet connects to your WSUS server using the UpdateServices module and dynamically creates the specified groups under the "All Computers" root level.

The Worklet accepts three configurable parameters: the WSUS server name, port number (defaulted to 8530), and a list of group names to create. This approach allows you to manage multiple groups in a single operation without manual WSUS console interaction.

Each group created by the Worklet appears immediately in your WSUS server hierarchy and becomes available for computer targeting. The Worklet checks for group existence before creation, preventing duplicate groups and failed operations.

Why organize endpoints with WSUS computer groups

WSUS computer target groups enable you to apply different update approval policies to different endpoint categories. Without proper group organization, you cannot effectively implement staged rollouts, pilot testing, or separate patching schedules for production versus non-production systems.

Manually creating WSUS groups through the console becomes time-consuming when managing hundreds of endpoints across multiple business units or departments. Automating group creation maintains consistency, eliminates typos, and allows IT operations teams to quickly scale their patch management infrastructure.

By grouping endpoints strategically, you align patch deployment with your organization's risk tolerance, change windows, and business needs. Groups for "Laptops," "Servers," and "Workstations" allow you to test updates on less critical systems before deploying to production infrastructure.

How WSUS target group creation works

  1. Evaluation phase: The Worklet queries the target WSUS server using Get-WsusServer to connect to the specified server and port. It iterates through the list of group names and uses GetComputerTargetGroups() to check if each group exists. If any group is missing, the endpoint flags for remediation.

  2. Remediation phase: The Worklet re-establishes the connection to the WSUS server and re-checks for existing groups. For any groups that do not exist, it calls CreateComputerTargetGroup() to create them under the "All Computers" root level. If group creation succeeds, the endpoint becomes compliant. If creation fails, the Worklet exits with an error and records the failure reason.

WSUS group creation requirements

  • Windows Server with WSUS role installed (includes UpdateServices module)

  • Network connectivity to the target WSUS server on the specified port (default 8530)

  • Administrative privileges or WSUS administrative credentials to create groups

  • Configured parameters: WSUS server name, port number, and desired group names (comma-separated or array format)

  • Endpoint targeting recommended to make the Worklet only applies to your designated WSUS server

Expected WSUS server state after group creation

After successful remediation, your WSUS server displays all requested computer target groups in the WSUS console under the "All Computers" hierarchy. You can verify this change by checking the specific setting this Worklet modifies. Each newly created group appears immediately and is ready to receive computer assignments.

You can verify success by navigating to the WSUS console, expanding Computers, and viewing All Computers to see all new groups listed alphabetically. The Worklet's output logs show "CREATED GROUP: [GroupName]" for each successfully created group and "All specified WSUS Computer Groups exist on [ServerName]" when all groups are confirmed present.

How to validate create wsus computer target groups changes

  1. Run this Worklet on a pilot Windows endpoint and review evaluation output for create wsus computer target groups.

  2. Confirm Automox activity logs show successful completion and exit code 0.

  3. Verify endpoint state using checks aligned to evaluation script logic, such as Get-WsusServer, Where-Object, Write-Output.

  4. Validate remediation effects from script operations such as Get-WsusServer, Where-Object, Write-Output, then rerun evaluation for compliance.

View in app
evalutation image
remediation image

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

do more with worklets