I use and script to genereat ldap.ldif files.
And the i include the ldif files in the ldap server.
My ldap fil is generated by an scipt an ever user get his own ldif file.

The genereated ldif file locks like this



dc: uid=matte,ou=Users,dc=ebox
cn: matte
uid: matte
sn: Mattias Hemmingsson
uidNumber: 10061
gidNumber: 10061
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: sambaSamAccount
sambaPwdCanChange: 0
sambaLogoffTime: 2147483647
sambaLogonTime: 0
sambaAcctFlags: [U]
sambaHomeDrive: H:
sambaKickoffTime: 2147483647
sambaPasswordHistory: 00000000000000000000000000000000000000000000000000000000
sambaPwdLastSet: 1243681419
sambaPwdMustChange: 2147483647
loginShell: /bin/bash
sambaHomePath: \\SERVER\homes\matte
sambaPrimaryGroupSID: S-1-5-21-3818554400-921237426-3143208535-513
sambaSID: S-1-5-21-3818554400-921237426-3143208535-5002
homeDirectory: /home/samba/users/matte
userPassword:: e1NTSEF9bys3VUZSNllYZ3htOFpiaVhGR3pqV3hMWlo5a1pEYzE=




Then I include the ldif file to the ldap server with this script


#!/bin/bash
#Script för att rensa upp i datorn varje dag
#
#
#
#
#pkill -9 -g students
#pkill -9 -u hallen
HOME='\\SERVER\homes\'


#Tar ut alla users till filen kill.log
#rm kill.log
#getent passwd >> kill.log
echo "#Genread av ldap export " > user/$user.ldif

# hämtar ut användarna och dödar deras processer

awk -F: '{print $1,$2,$3,$5}' kill.log | while read user group pid name
do
echo "Importing $user"
slapadd -l user/$user.ldif
done


And the you have to change the password for every user.
I use this to migrade my ldap from an old ldap server to the new.


// Matte







----- Ursprungligt meddelande -----
Från: "Javier Amor Garcia" <[email protected]>
Till: "eBox users" <[email protected]>
Skickat: fredag, 12 feb 2010 12:26:24
Ämne: Re: [ebox-user] Script to create users...

Another option, just posted in the forum:
http://forum.ebox-platform.com/index.php?topic=2962.0;topicseen

Jorge Eduardo Quintão wrote:
> Hi,
> 
> Some of you have a script do create users in batch mode... I need create 
> many users (+/- 100) and it can be very hard in the web interface...
> 
> Thanks,
> NetSol
> *10 ANOS*
> 
>       Jorge Eduardo Quintão
> Diretor de Inovação
> 
> Tel: +55 31 3071-8001
> Fax: +55 31 3071-8040
> Site: www.netsol.com.br
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ebox-user mailing list
> [email protected]
> http://lists.ebox-platform.com/cgi-bin/mailman/listinfo/ebox-user

_______________________________________________
ebox-user mailing list
[email protected]
http://lists.ebox-platform.com/cgi-bin/mailman/listinfo/ebox-user
_______________________________________________
ebox-user mailing list
[email protected]
http://lists.ebox-platform.com/cgi-bin/mailman/listinfo/ebox-user

Reply via email to