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