Assign user accounts to a group
To manage similar user accounts more easily, you can assign them to a group so that the user accounts inherit the properties, such as IT polices, software configurations, and WLAN configurations, of the group. You can assign a user account to multiple groups using the
addUsersToGroup() method. To assign one user account to a group, you can use the
addUserToGroup() method instead.
Before you begin: Retrieve the following data objects and variables:
- userIDs integer array for the user account IDs that you want to add to the group
- groupID integer for the group ID of the group you want to add the user accounts to
- Invoke addUserToGroup().
AddUsersToGroupRequest request = new addUsersToGroup();
request.userIds = userIDs;
request.groupId = groupID;
AddUsersToGroupResponse response = coreWebService.addUsersToGroup(request);
AddUsersToGroupResult result = response.returnValue;
- Check the result for errors and handle any errors.
if (result.addUsersToGroupReturnStatus.code != AddUserToGroupReturnStatusEnumType.SUCCESS)
{
// handle any errors
}
Was this information helpful? Send us your comments.