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

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

        FormField field = form.addField();
        field.setType(FormField.Type.hidden);
        field.setVariable("FORM_TYPE");
        field.addValue("http://jabber.org/protocol/admin");

        field = form.addField();
        field.setType(FormField.Type.text_single);
        field.setLabel(LocaleUtils.getLocalizedString("commands.admin.getnumberdisabledusers.form.field.disabledusersnum.label", preferredLocale));
        field.setVariable("disabledusersnum");

        // TODO improve on this, as this is not efficient on systems with large amounts of users.
        int count = 0;
        final LockOutManager lockOutManager = LockOutManager.getInstance();
        for (final User user : UserManager.getInstance().getUsers()) {
            if (lockOutManager.isAccountDisabled(user.getUsername())) {
                count++;
            }
        }
        field.addValue(count);

        command.add(form.getElement());
    }
Command that allows to retrieve the number of disabled users

@author Guus der Kinderen, guus@goodbytes.nl
@see <a href="https://xmpp.org/extensions/xep-0133.html#get-disabled-users-num">XEP-0133 Service Administration: Get Number of Disabled Users</a>
xmppserver/src/main/java/org/jivesoftware/openfire/commands/admin/GetNumberDisabledUsers.java