After some research I found steps how to store users in the LDAP (OpenLDAP server) under Windows.
- Change configuration file
slapd.conf
ucdata-path ./ucdata
include ./schema/core.schema
include ./schema/cosine.schema
include ./schema/inetorgperson.schema
include ./schema/misc.schema
include ./schema/nis.schema
include ./schema/openldap.schema
pidfile ./run/slapd.pid
argsfile ./run/slapd.args
access to *
by self write
by users read
by anonymous read
#######################################################################
# BDB database definitions
#######################################################################
database bdb
suffix "o=sample company"
rootdn "cn=Manager,o=sample company"
rootpw secret
directory ./data
index objectClass eq - Restart LDAP service
restart.bat
net stop OpenLDAP-slapd
net start OpenLDAP-slapd - Create base record
base.ldif
dn: o=sample company
objectclass: organization
objectclass: top
o: sample company - Insert base record into LDAP
base.bat
@echo off
set LDAP_HOME=E:\devenv\tools\OpenLDAP
set BASE="o=sample company"
set D=cn=Manager,%BASE%
set AUTH=-x -w secret -D %D%
%LDAP_HOME%\ldapadd.exe %AUTH% -a -f base.ldif - Create file with users' definitions
user.ldif
dn: cn=Katrien,o=sample company
objectClass: top
objectClass: person
objectClass: inetorgperson
cn: Katrien
sn: none
userPassword: none
mail: katrien@samplecompany.com
dn: cn=Gordon,o=sample company
objectClass: top
objectClass: person
objectClass: inetorgperson
cn: Gordon
sn: none
userPassword: none
mail: Gordon@samplecompany.com - Insert users into LDAP
user.bat
@echo off
set LDAP_HOME=E:\devenv\tools\OpenLDAP
set BASE="o=sample company"
set D=cn=Manager,%BASE%
set AUTH=-x -w secret -D %D%
%LDAP_HOME%\ldapadd.exe %AUTH% -a -f user.ldif - Check LDAP records
search.bat
@echo off
set LDAP_HOME=E:\devenv\tools\OpenLDAP
set BASE="o=sample company"
set D=cn=Manager,%BASE%
set AUTH=-x -w secret -D %D%
%LDAP_HOME%\ldapsearch.exe -LLL %AUTH% -b %BASE% "objectClass=person"
No comments:
Post a Comment