Renaming a user profile
The system does not provide a direct method for renaming a user profile. A new profile can be created with the same authorities for a user with a new name.
Some information, however, cannot be transferred to the new profile. The following are examples of information that cannot be transferred:
- Spool files.
- Internal objects containing user preferences and other information about the user will be lost.
- Digital certificates that contain the user name will be invalidated.
- The uid and gid information retained by the integrated file system cannot be changed.
- You might not be able to change the information that is stored by applications that contain the user name.
Applications that are run by the user can have application profiles. Creating a new IBM® i user profile to rename a user does not rename any application profiles the user might have. A Lotus® Notes® profile is one example of an application profile.
The following example shows how to create a new profile for a user with a new name and the same authorities. The old profile name is SMITHM, while the new user profile name is JONESM:
- Copy the old profile (SMITHM) to a new profile (JONESM) using the copy option from the Work with User Enrollment display.
- Give JONESM all the private authorities of SMITHM using the Grant
User Authority (GRTUSRAUT) command:
GRTUSRAUT JONESM REFUSER(SMITHM)
- Change the primary group of all objects that SMITHM is the primary
group of using the Work with Objects by Primary Group (WRKOBJPGP)
Enter option 9 on all objects that need their primary group changed and enter NEWPGP (JONESM) on the command line.Note: JONESM must have a gid assigned using the GID parameter on the Create or Change User Profile (CRTUSRPRF or CHGUSRPRF) command.
- Display the SMITHM user profile using the Display User Profile
DSPUSRPRF USRPRF(SMITHM)Write down the uid and gid for SMITHM.
- Transfer ownership of all other owned objects to JONESM and remove the SMITHM user profile, using option 4 (Remove) from the Work with User Enrollment display.
- Change the uid and the gid of JONESM to the uid and gid that belonged
to SMITHM by using the Change User Profile (CHGUSRPRF)
CHGUSRPRF USRPRF(JONESM) UID(uid from SMITHM) GID(gid from SMITHM)
If JONESM owns objects in a directory, the CHGUSRPRF command cannot be used to change the uid and gid. Use the QSYCHGID API to change the uid and gid of user profile JONESM.