Customers may ask how to find out if a profile is being used. Usually they are looking to clean up some profiles. This document provides reports to assist finding unused profiles.
Resolving The Problem
Based on the last Sign On Date
|1.||You need to build a file that contains the following user profile information:|
DSPUSRPRF USRPRF(*ALL) OUTPUT(*OUTFILE) OUTFILE(QGPL/unused)
You can use any library/filename.
|2.||Then start SQL. Sample statements follow:|
A very basic report listing all users and their signon date:
SELECT UPUPRF, UPPSOD FROM qgpl/unused
Sorted by Date:
SELECT UPUPRF, UPPSOD FROM qgpl/unused ORDER BY UPPSOD
Sorted by Date Descending:
SELECT UPUPRF, UPPSOD FROM qgpl/unused ORDER BY UPPSOD DESC
For just one user:
SELECT UPUPRF, UPPSOD FROM qgpl/unused WHERE UPUPRF ='ADAM'
The string in quotes ('ADAM') is case sensitive.
Based on the Last Used Date
If you are using this report to identify 'unused' profiles, Last Signon is not the only thing to consider. Profiles can be used for things other than signon that would be impacted by deleting them (examples could be owning objects, adopted authority on programs, and so on).
In this case, it is a good idea to take a look at the Last Used date in the Object Description before deleting the profile. You can do something similar to the above; for example, use a different command and different field names; however, it would be the same idea:
DSPOBJD OBJ(*ALL) OBJTYPE(*USRPRF) OUTPUT(*OUTFILE) OUTFILE(QGPL/lastused)
SELECT ODOBNM, ODUDAT FROM QGPL/lastused
Like the samples above, you can Order By the Last Used date (=ODUDAT Last Used Date) or select for a certain user (ODOBNM = Object Name which will be the profile name in this case).
To get results output to print or file and then displayed to the screen:
F13 for Services
1. Change session attributes
SELECT output . . . . . . . . 2 2=Printer 3=File
11 November 2019