The script (http://docs.nethserver.org/en/latest/accounts.html#import-users ) works perfectly but is it possible to add fields matching groups
User1 depends of group Group1
User2 depends of group Group2
…
I would like to test with a lot of users and I’ll take a long time to associate them to the groups.
No way to do this now, maybe in the future. A customer asked this feature yet, on payment, hence it will probably be released on NethServer as well.
giacomo
(Giacomo Sanchietti)
April 30, 2015, 6:55pm
4
When the customer will pay, the feature will be available to all, for sure!
1 Like
stephdl
(Stéphane de Labrusse)
April 30, 2015, 8:11pm
5
Thanks to this unknown benefactor
1 Like
alefattorini
(Alessio Fattorini)
Split this topic
April 30, 2015, 10:49pm
6
I moved a post to a new topic: New selector for groups
zamboni
(Stefano)
May 7, 2015, 4:44pm
7
well
a script like this one:
while read p; do
#echo $p
user=`echo $p | cut -d \| -f 1`
group=`echo $p | cut -d \| -f 2`
actmembers=$(db accounts getprop $group Members)
if [ $actmembers ]; then
db accounts setprop $group Members $actmembers,$user
else
db accounts setprop $group Members $user
fi
signal-event group-modify $group
done <import.lst
and a file like
user1|group1
user1|group2
user2|group2
should do the trick
tested only a bit, YMMV
2 Likes
Very good man. Thanks a lot!
stephdl
(Stéphane de Labrusse)
May 7, 2015, 5:56pm
9
the script to import is there /usr/share/doc/nethserver-directory-2.2.0/import_users
that could be tricked in perl