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

        Group group;
        try {
            group = GroupManager.getInstance().getGroup(data.getData().get("group").get(0));
        } catch (GroupNotFoundException e) {
            // Group not found
            Element note = command.addElement("note");
            note.addAttribute("type", "error");
            note.setText(LocaleUtils.getLocalizedString("commands.admin.group.getlistgroupusers.note.group-does-not-exist", preferredLocale));
            return;
        }

        DataForm form = new DataForm(DataForm.Type.result);

        form.addReportedField("jid", LocaleUtils.getLocalizedString("commands.admin.group.getlistgroupusers.form.reportedfield.jid.label", preferredLocale), FormField.Type.jid_single);
        form.addReportedField("admin", LocaleUtils.getLocalizedString("commands.admin.group.getlistgroupusers.form.reportedfield.admin.label", preferredLocale), FormField.Type.boolean_type);

        // Add group members the result
        for (JID memberJID : group.getMembers()) {
            Map<String,Object> fields = new HashMap<>();
            fields.put("jid", memberJID.toString());
            fields.put("admin", false);
            form.addItemFields(fields);
        }
        // Add group admins the result
        for (JID memberJID : group.getAdmins()) {
            Map<String,Object> fields = new HashMap<>();
            fields.put("jid", memberJID.toString());
            fields.put("admin", true);
            form.addItemFields(fields);
        }
        command.add(form.getElement());
    }
Command that allows to retrieve list members of a given group.

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