[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] Adding Users in Direcotry_administrator - Help!



k12osn redhat com writes:
>Thank you for the ideas.  I used the ldaphacks from the link on another 
>email message.  I'm not sure who it was on this list right now, but the
>user 
>had a functioning system up and running... I think!

It's me.  I have a running Samba/LDAP server, but I did it differently
than Eric has....I have a how-to posted here
http://www.vcs.u52.k12.me.us/linux  Most recently I had run into the
problem of adding users in bulk....with the help of people on this list
(thanks Barry)I solved that...here's how (bear in mind that this takes
into account that you have the smbldap tools installed from www.idealx.org

I used the script just as it was written on the list.  Here it is below....
+++++++++++++++++++++++++++++++++
In your case, you could read all of the variables in from a text file,
comma delimited...
For example:
A file containing use information called usserinfo:

First,last,group,password,username

Scooby,Doo,1001,hewwowaggy,sdoo


#!/bin/sh
Cat userinfo|while read line; do
first=$(echo $line|cut -f1 -d ',')
last=$(echo $line|cut -f2 -d ',')
gid=$(echo $line|cut -f3 -d ',')
password=$(echo $line|cut -f4 -d ',')
uname=$(echo $line|cut -f5 -d ',')
smbldap-useradd.pl -a -m -g $gid -c "$first $last" $uname
echo -e $password\\n$password|smbldap-passwd.pl $uname
chown -Rf $uname.$gid /home/$uname
chmod -Rf og+rX-w,u+rwX /home/$uname
done


I saved the above script with a name like   useraddscript.sh     and ran
it using      

. useraddscript.sh

(make sure the userinfo file you create with the user information and
passwords is in the same directory)  One word of caution....there will be
an error message that pops up with each time it works on a user....doesn't
mean anything...it still works....you'll see a message that says "all
authentication tokens updated"   this means it's working fine.  Ignore the
little error.  If you get more than that...then worry.  NOTE:  as a group
we need to find a way to make the message go away.....

David N. Trask
Technology Teacher/Coordinator
Vassalboro Community School
dtrask vcs u52 k12 me us
(207)923-3100




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]