Thanks, Flo, that is good to know.

I was trying to write up documentation for n00bz about how to add a user.

Trying for K.I.S.S.

 

From: Florence Blanc-Renaud <flo@redhat.com>
Date: Thursday, January 16, 2020 at 05:41
To: FreeIPA users list <freeipa-users@lists.fedorahosted.org>
Cc: Daniel White <daniel.e.white@nasa.gov>
Subject: [EXTERNAL] Re: [Freeipa-users] Question about ipa group-add-member

 

On 1/15/20 6:17 PM, White, Daniel E. (GSFC-770.0)[NICS] via

FreeIPA-users wrote:

Adding multiple users to one group is documented, but the other way

around seems to be missing.

Is there a way to add one user to multiple groups with one command ?

Hi,

 

with the GUI you can navigate to your user, then click on User Groups

and Add. Then select multiple groups to be added to.

 

With the cli there is no such command. You can either call ipa

group-add-member for each group, or create a batch command (it is more

efficient as it's reusing the same connection for all the commands).

 

For instance create the file batch.json with:

{"method":"batch","params":[[

{"method":"group_add_member","params":[["group1"],{"user":"user1"}]},

{"method":"group_add_member","params":[["group2"],{"user":"user1"}]}

         ],{}],"id":1}

 

Then use curl to execute the batch command:

 

kinit admin

curl -H "Content-Type:application/json" \