user management utility code moved from portal.