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 ? If not, I can deal with it.
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" \ -H "Accept:application/json" \ -H "Accept-Language:en" \ -H referer:https://%60hostname%60/ipa \ --negotiate -u : \ --cacert /etc/ipa/ca.crt \ -d @/tmp/batch.json -X POST \ https://%60hostname%60/ipa/json
flo
If not, I can deal with it.
FreeIPA-users mailing list -- freeipa-users@lists.fedorahosted.org To unsubscribe send an email to freeipa-users-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/freeipa-users@lists.fedorahoste...
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" \
freeipa-users@lists.fedorahosted.org