Hello Everyone,

The past couple of days I have been looking for a way to create a bunch
of users with the same attributes and group membership(s)... The
nambulkadd command will do a portion of the but does not have the same
capability as namuseradd or namusermod, so i wrote a little script that
will do most of what I need except it will not put in the First and Last
name of the user in eDir and I dont think there is a way to do so but
may be wrong... I made the script as generic as possible and easy to
read for those who are not that savvy with bash scripting... Anyways,
here it is! Also, does anyone know how to publish a "Cool Solution"

Thanks!

-scz

#!/bin/bash

##-- This script will create a bunch of users, LUM enable them (optional
but will require some slight modification) and add the users to
specified groups --##




##-- DEPENDENCIES --##
##-- You must create two files "my_users" and "passwords" in the
directory where the script resides... The file "my_users" should contain
your user names and the file "passwords" should contain the passwords
for the users...




ADMINCONTEXT="cn=admin,o=yourORG"
USERCONTEXT="ou=users,o=yourORG"
ADMINPASSWD="ADMINpasswd"
GROUPLIST="-G cn=group1,ou=groups,o=yourORG -G
cn=group2,ou=groups,o=yourORG"
PRILUMGRP="cn=LUMUSERS,ou=groups,o=yourORG"
SHELL="/bin/false"
USERS=`cat my_users`
PASSWD=`cat passwords`



array1=( $USERS );
array2=( $PASSWD );


arraylen=${#array1[@]}
i=0;


while [ "$i" -lt "$arraylen" ]
do
eltfrom1=${array1["$i"]};
eltfrom2=${array2["$i"]};
namuseradd -a $ADMINCONTEXT -w $ADMINPASSWD -x $USERCONTEXT -g
$PRILUMGRP $GROUPLIST -k /etc/skel -m -s $SHELL -P -p $eltfrom2 -d
/home/users/$eltfrom1 $eltfrom1;

let "i = $i + 1";
done