private void createUser(final UserDesc userName) {
        final String msg = LogUtil.message("Creating user '{}'", userName);
        info(LOGGER, msg);

        try {
            userService.getUserBySubjectId(userName.getSubjectId())
                    .ifPresentOrElse(
                            user -> {
                                if (!user.isEnabled()) {
                                    final String outcomeMsg = LogUtil
                                            .message("User '{}' already exists but is disabled, enabling",
                                                    user.asRef().toInfoString());
                                    user.setEnabled(true);
                                    userService.update(user);
                                    indentedWarn(LOGGER, outcomeMsg, "  ");
                                    logCreateUserEvent(userName, false, outcomeMsg);
                                } else {
                                    final String outcomeMsg = LogUtil.message("User '{}' already exists",
                                            user.asRef().toInfoString());
                                    indentedWarn(LOGGER, outcomeMsg, "  ");
                                    logCreateUserEvent(userName, false, outcomeMsg);
                                }
                            },
                            () -> {
                                userService.getOrCreateUser(userName);
                                logCreateUserEvent(userName, true, null);
                                indentedInfo(LOGGER,
                                        "Created user '" + userName + "'",
                                        "  ");
                            });
        } catch (Exception e) {
            LOGGER.debug("Error", e);
            throw new RuntimeException("Error " + msg + ":" + e.getMessage(), e);
        }
    }
Creates an account in the internal identity provider
<p>
e.g manage_users ../local.yml
--createUser admin
--createGroup Administrators
--addToGroup admin Administrators
--grantPermission Administrators Administrator
stroom-app/src/main/java/stroom/app/commands/ManageUsersCommand.java