[Samba] Import USER and PASSWORD Samba3+OpenLadp TO Samba4

L.P.H. van Belle belle at bazuin.nl
Wed Aug 26 15:26:32 UTC 2015

just make a CSV file and import your users. 

this is the script i used. 

## example
## display naam in AD wil be : Louis van Belle (
cat /home/samba/backup/users.csv | awk -F ";" '{system("/usr/bin/samba-tool user add "$5" --mail-address="$7" \
--given-name="$4" --surname=\""$3"\" --telephone-number="$6" --department="$1" --description=\""$1"\" \
--random-password --userou=ou=Company")}';

the layout of the CSV( which i got from an export of my samba3+ldap) 
IT-Department;L.P.H.;van Belle;Louis;my-loginname;phonenummer;e-mail at domain.tld;

use : samba-tool user add --help 
for more examples

this is how it for you would be.. where the password is WelkomUsername

/usr/bin/samba-tool user add "$5" "Welkom$5" --mail-address="$7" \
--given-name="$2" --surname=\""$3"\" --telephone-number="$6" \
--department="$1" --description=\""$1"\" --userou=ou=Company \

Just notice that i made an separated OU for my company.. ( see also the help ) 



>-----Oorspronkelijk bericht-----
>Van: samba [mailto:samba-bounces at lists.samba.org] Namens vinifa
>Verzonden: woensdag 26 augustus 2015 17:01
>Aan: samba at lists.samba.org
>Onderwerp: Re: [Samba] Import USER and PASSWORD 
>Samba3+OpenLadp TO Samba4
>Really did not work, if I create a user in RSAT no password, 
>and select the
>option to change password at next logon, works. Now if I 
>import the LDIF
>even enabling this function does not work. This issue of 
>password, you know
>how I can put a default password for all users, such as 123456?
>I did not understand what you sent me.
>replace: unicodePwd
>unicodePwd :: $ unicodePwd "
>To get $ unicodePwd, I would do this:
>UnicodePwd = $ (echo -n "\" $ _ user_pw \ "" | $ _ICONV -f -t 
>$ _BASE64 -w 0)
>View this message in context: 
>Sent from the Samba - General mailing list archive at Nabble.com.
>To unsubscribe from this list go to the following URL and read the
>instructions:  https://lists.samba.org/mailman/options/samba

More information about the samba mailing list