Signed on as a profile that has *secofr capability- run the following:
DSPUSRPRF USRPRF(*ALL) OUTPUT(*OUTFILE) OUTFILE(QTEMP/USERS)
This will create a file in QTEMP called USERS that can be queried and sorted however you want…
But note that only user profiles to which you have authority will be included in the file. This may require both *ALLOBJ and *SECADM special authorities to see <i>all </i>user profiles.