You can use the CLI to manage user information, update user roles, and move users between organizations.
To view a all the users currently in your organization, you can export a list from the Users list in the Code42 console or you can use the
You can use optional flags to filter the users you want to view. The following command will print all active users with the
Desktop User role who belong to the organization with UID
code42 users list --org-uid 1234567890 --role-name "Desktop User" --active
To change the information for one or more users, provide the user UID and updated information with the
bulk update commands.
Manage User Roles¶
Apply Code42’s user roles to user accounts to provide administrators with the desired set of permissions. Each role has associated permissions, limitations, and recommended use cases.
View User Roles¶
View a user’s current roles and other details with the
code42 users show "email@example.com"
Alternatively, pass the
--include-roles flag to the
list command. The following command will print a list of all active users and their current roles:
code42 users list --active --include-roles
Update User Roles¶
Use the following command to add a role to a user:
code42 users add-role --username "firstname.lastname@example.org" --role-name "Desktop User"
Similarly, use the
remove-role command to remove a role from a user.
Deactivate a User¶
You can deactivate a user with the following command:
code42 users deactivate email@example.com
To deactivate multiple users at once, enter each username on a new line in a CSV file, then use the
bulk deactivate command with the CSV file path. For example:
code42 users bulk deactivate users_to_deactivate.csv
Similarly, use the
bulk reactivate commands to reactivate a user.
Assign an Organization¶
Use Organizations to group users together in the Code42 environment.
You’ll need an organization’s unique identifier number (UID) to move a user into it. You can use the
list command to view a list of all current user organizations, including UIDs:
code42 users orgs list
show command to view all the details of a user organization.
As an example, to print the details of an organization associated with the UID
123456789 in JSON format:
code42 users show 123456789 -f JSON
Once you’ve identified your organizations UID number, use the
move command to move a user into that organization. In the following example a user is moved into the organization associated with the UID
code42 users move --username firstname.lastname@example.org --org-id 1234567890
Alternatively, to move multiple users between organizations, fill out the
move CSV file template, then use the
bulk move command with the CSV file path.
code42 users bulk move bulk-command.csv
Get CSV Template¶
The following command generates a CSV template to either update users’ data, or move users between organizations. The csv file is saved to the current working directory.
code42 trusted-activities bulk generate-template [update|move]
Once generated, fill out and use each of the CSV templates with their respective bulk commands.
code42 trusted-activities bulk [update|move|reactivate|deactivate] bulk-command.csv
A CSV with a
username column and a single username on each new line is used for the
deactivate bulk commands. These commands are not available as options for
Learn more about Managing Users.