IBM Support

Finding Unused Profiles

Technote (troubleshooting)


Problem(Abstract)

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:

STRSQL

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)
STRSQL
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:

STRSQL
F13 for Services
1. Change session attributes
SELECT output . . . . . . . . 2 2=Printer 3=File


Cross reference information
Segment Product Component Platform Version Edition
Operating System IBM i 7.2
Operating System IBM i 7.1
Operating System IBM i 6.1

Historical Number

496566804

Document information

More support for: IBM i
Security

Software version: 5.3.0, 5.3.5, 5.4.0, 5.4.5, 6.1, 6.1.0, 6.1.1, 7.1, 7.1.0, 7.2

Operating system(s): IBM i

Reference #: N1013520

Modified date: 04 October 2012