Avatar of dllssn
dllssn
 asked on

user profiles AS400

I need to mass update user profiles in the AS400 programmically. What is the name of the file and library in order to do this?
Operating SystemsIBM System i

Avatar of undefined
Last Comment
Member_2_276102

8/22/2022 - Mon
WaldenL

OS/400 isn't unix! There is no "file" that contains the user profile objects. You'll need to issue a CHGUSRPRF command in a loop to do what you need. You can build a file w/the current user profile info by doing a DSPUSRPRF to an outfile, but any updates there will have no effect.

What are you trying to change?

-Walden
dllssn

ASKER
I want to do a mass delete of users from a dspusrprf outfile.
WaldenL

ok , then the command is DLTUSRPRF. However, be careful, you have to answer questions before you do that like, "what should I do with object's owned by this user". Do one delete by hand to get a feel and then move forward from there.

-Walden
Your help has saved me hundreds of hours of internet surfing.
fblack61
Theo Kouwenhoven

Hi what you can do is:
  WRKUSRPRF *ALL
Now if you like to change e.g. the initial menu:
you can put option 2 in front of every line that you like to update and on the commandline you type:
INLMNU(MyLib/MyMenu)

You also can chnage more then 1 keyword, in that case type on the command line e.g.
INLMNU(MyLib/MyMenu)  GRPPRF(GRP01)
This set all selected users to the new menu and assign them to group GRP01

An other posibility is to execute the change command from a program by executing this for each user:
CHGUSRPRF USRPRF(MyUser)   INLMNU(MyLib/MyMenu)

To get all users as input, you can list them all to an file with command.
DSPUSRPRF USRPRF(*ALL)  TYPE(*BASIC)  OUTPUT(*OUTFILE)  OUTFILE(MYLIB/MYUSERS)  

So a massupdate is possible but not directly in a file.

Regards,
Murph

BTW
in the DSPUSRPRF you ony see users that are within yout authorisation
To change the usersprofiles with CHGUSRPRF you need to have *SECADM rights in your profile.
 

Theo Kouwenhoven

A posibility is to let SQL write a CL-pgm for you with the file from DSPUSRPRF as input:

select 'DLTUSRPRF USRPRF(' concat trim(UPUPRF) concat ')'  from itmmst  
where

Regards,
Murph
                                           
ASKER CERTIFIED SOLUTION
Member_2_276102

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.