How To Add Users To Groups Through udm
In case you have multiple users and you need to add them to one group without changing the existing group memberships you can not use UMC for this as it will overwrite existing group memberships.
Put the names of your users into a text file called userlist with their uids as follows:
user1 user2 user3 ...
Get the distinguished names of your users and create a list of them.
Put the following into a file
get_dn.sh and start by
#!/bin/bash rm -f userlist.dn for i in $(cat userlist) ; do univention-ldapsearch -LLL "uid=$i" dn| grep -vE "^$"| cut -d " " -f2>> userlist.dn done
Identify the distinguished name (dn) of the group you want to add the users ie by the following way:
univention-ldapsearch "cn=Group1" dn
Combine the above results to add the users to your groups by using the
for dn in $(cat userlist.dn) ; do \ udm users/user modify --dn "$dn" --append groups="<DN of GROUP from above>" ; \ done