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

[K12OSN] Bulk user help for LDAP/Samba



I could use some help creating a mass (bulk) import user script for my
LDAP/Samba set up.  I have two scripts that I use to create my
users....they are:

smbldap-useradd.pl    
http://www.vcs.u52.k12.me.us/linux/smbldap-useradd.pl

smbldap-passwd.pl      http://www.vcs.u52.k12.me.us/linux/smbldap-passwd.pl

I've posted them for anyone who wants a look or they're also at
www.idealx.org  in the Samba projects area under smbldap-tools.

Now....here's where I'm at....I have created a simple shell to create the
users.....did this using a spreadsheet program....quite easy to do...and
it works....example below...

#!/bin/sh
smbldap-useradd.pl -a -m -c "Scooby Doo" sdoo
smbldap-useradd.pl -a -m -c "Daffy Duck" dduck
smbldap-useradd.pl -a -m -c "Rudolph Reindeer" rreindeer
smbldap-useradd.pl -a -m -c "Kris Kringle" kkringle

Easy enough....but adding the passwords is where it gets me....the
smbldap-passwd.pl script from above prompts for a password...and then I
need to type it in.  What I need to be able to do is get the password onto
the command line with the script....like so...possibly

#!/bin/sh
smbldap-passwd sdoo | mysecretpwd
smbldap-passwd dduck | myothersecretpwd

and so forth.....or I can use any other better ideas....can any of you
scripting pros out there give me a hand?  Thanks!

I'd like to be able to have the script use a text file similar to   
username,First Name Last Name, password  (possibly group?)

right now I use the following command  

smbldap-useradd.pl -a -m -c "John Doe" jdoe

That adds the user...and then I have to run the password script....

smbldap-passwd.pl jdoe
type new password:
retype new password:

It's the password prompt that throws me...otherwise I could simply do it
all with a shell script....

smbldap-passwd jsmith
smbldap-passwd jdoe
smbldap-passwd jjohnson
smbldap-passwd msmith

so forth and so on.....

Can anyone help out?  I haven't a clue about perl scripts and I could
really use the help.....fame and fortune could be yours...not to mention
my gratitude and the gratitude of others who would use this.

Thanks!  :-)

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]