OUD – Sample Ldif Script


#!/bin/ksh 

source ~/oudr2ps3.env
set -x 
 
V1=V$RANDOM 
V2=new-$V1 

ldapmodify  -h localhost -p 1389 -D "cn=directory manager" -w Welcome1 <<!
dn: cn=u0,dc=example,dc=com
changetype: modify
replace: displayName
displayName: $V1
!
 
ldapmodify   -h localhost -p 1389 -D "cn=directory manager" -w Welcome1 <<!
dn: cn=u0,dc=example,dc=com
changetype:modify
delete: displayName
displayName: $V1
-
add: displayName
displayname: $V2
!

 
sleep 2 

ldapsearch -h localhost -p 1389 -D "cn=directory manager" -w Welcome1 -b "cn=u0,dc=example,dc=com" objectclass=*  displayName 

ldapsearch -h localhost -p 1389 -D "cn=directory manager" -w Welcome1 -b "cn=u0,dc=example,dc=com" objectclass=*  displayName 

sleep 2 

ldapsearch -h localhost -p 1389 -D "cn=directory manager" -w Welcome1 -b "cn=u0,dc=example,dc=com" objectclass=*  displayName

OUD – Sample LDIF File

$ ldapmodify -a -p 1389 -D “cn=Directory Manager” -w Welcome1

dn: dc=example,dc=com
objectclass: top
objectclass: domain
dc: example

dn: ou=people,dc=example,dc=com
changetype: add
objectclass: top
objectclass: organizationalUnit
ou: people

dn: uid=ste,ou=people,dc=example,dc=com
postalAddress: Schwielowsee
postalCode: 14548
uid: ste
description: This is the description for stefan0
userPassword: password
employeeNumber: 23
initials: SW
givenName: Stefan
objectClass: person
objectClass: inetorgperson
objectClass: organizationalperson
objectClass: top
pager: +1 724 334 4454
mobile: +1 699 006 9072
cn: Stefan W
sn: W
roomNumber: 123
telephoneNumber: 456
street: Auf dem Franzensberg
homePhone: +1 698 343 6105
l: Potsdam
mail: stefan@maildomain.net
st: BR