@Override
    public void execute(@Nonnull final SessionData data, Element command) {
        final Locale preferredLocale = SessionManager.getInstance().getLocaleForSession(data.getOwner());

        Element note = command.addElement("note");
        // Check if groups cannot be modified (backend is read-only)
        if (GroupManager.getInstance().isReadOnly()) {
            note.addAttribute("type", "error");
            note.setText(LocaleUtils.getLocalizedString("commands.admin.group.deletegroupusers.note.groups-readonly", preferredLocale));
            return;
        }
        // Get requested group
        Group group;
        try {
            group = GroupManager.getInstance().getGroup(data.getData().get("group").get(0));
        } catch (GroupNotFoundException e) {
            // Group not found
            note.addAttribute("type", "error");
            note.setText(LocaleUtils.getLocalizedString("commands.admin.group.deletegroupusers.note.group-does-not-exist", preferredLocale));
            return;
        }

        boolean withErrors = false;
        for (String user : data.getData().get("users")) {
            try {
                group.getAdmins().remove(new JID(user));
                group.getMembers().remove(new JID(user));
            } catch (Exception e) {
                Log.warn("User not deleted from group", e);
                withErrors = true;
            }
        }

        note.addAttribute("type", "info");
        note.setText(LocaleUtils.getLocalizedString((withErrors ? "commands.global.operation.finished.with-errors" : "commands.global.operation.finished.success"), preferredLocale));
    }
Command that allows to delete members or admins from a given group.

@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/commands/admin/group/DeleteGroupUsers.java