Category filter

Scripts to add users to a group on Windows devices

User Management on Windows devices becomes easier when the users are grouped. Hexnode lets admins deploy scripts to group users on multiple devices simultaneously.

Note:


Supported Versions:

The scripts given below will be supported on the following versions:

  • Windows 10 v1607+ (Pro, Enterprise, Education)
  • Windows 11 (Pro, Enterprise, Education)


Disclaimer:

The sample scripts provided below are adapted from third-party open-source sites.

Batch Script

E.g., To add the user Josh to the group of Users,

net localgroup Users Josh /add

PowerShell Script


$group = "group name"

$user = “user name”

In the above script, replace the terms “group name” and “user name” with the actual names. For example, to add the user Josh to the group Users the script should be:


$group = "Users"

$user = “Josh”

Script output message displayed in the Action History tab in Hexnode UEM portal

Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

Sample Script Repository