Remove user accounts from a group
You can remove multiple user accounts from a group using the multi-object
RemoveUsersFromGroup() method in the
corews web service. To remove one user from a group, you can use the single-object
RemoveUserFromGroup()
method.
Before you begin: Retrieve the following variables:
- userIDs integer array for the IDs of the user accounts that you want to remove from to a group
- groupID integer for the ID of the group you want to remove the user from
- Invoke RemoveUsersFromGroup().
RemoveUsersFromGroupRequest request = new removeUsersFromGroup();
request.userIds = userIDs;
request.groupId = groupID;
RemoveUsersFromGroupResponse response = coreWebService.removeUsersFromGroup(request);
RemoveUsersFromGroupResult result = response.returnValue;
- Check the result for errors and handle any errors.
if (result.removeUsersFromGroupReturnStatus.code != RemoveUserFromGroupReturnStatusEnumType.SUCCESS)
{
// handle any errors
}
Was this information helpful? Send us your comments.