LDAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesLDAP Programming

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 9th, 2008, 02:49 PM
imad77 imad77 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 1 imad77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m 51 sec
Reputation Power: 0
Check LDAP commands and LDIF files

Hi,

I'm new in LDAP scripting and I need your help.

I have this LDAP entries:
========
dn: cn=10
cn: denis.major
sn: magor
givenName: denis
mail: denis.major
displayName: denis major

dn: cn=12
cn: samy.gold
sn: golddd
givenName: samy
mail: samy.gold
displayName: samy gold

dn: cn=13
cn: irea.gord
sn: gord
givenName: irena
mail: irea.gord
displayName: irena gord

dn: cn=14
cn: stuff
sn: Stuff
givenName: John
mail: stuff
displayName: Stuff

dn: cn=20
cn: jean.paul
sn: Paul
givenName: jean
mail: jean.paul
displayName: jean paul

dn: cn=21
cn: Gilles.paul
sn: paul
givenName: Gilles
mail: Gilles.paul
displayName: Gilles paul

dn: cn=30
cn: carl.fred
sn: fred
givenName: carl
mail: carl.fred
displayName: carl fred

dn: cn=40
cn: george.fredy
sn: fredy
givenName: george
mail: george.fredy
displayName: george fredy

dn: cn=41
cn: george.Trad
sn: Trad
givenName: george
mail: george.Trad
displayName: george Trad
========

I want to add the 2 new entries cn=20 and cn=21 and their data to the LDAP:

dn: cn=20
cn: jean.paul
sn: Paul
givenName: jean
mail: jean.paul
displayName: jean paul

dn: cn=21
cn: Gilles.paul
sn: Paul
givenName: Gilles
mail: Gilles.paul
displayName: Gilles paul

I want to delete the 2 entries cn=40 and cn=41 their data from the LDAP:

dn: cn=40
cn: george.fredy
sn: fredy
givenName: george
mail: george.fredy
displayName: george fredy

dn: cn=41
cn: george.Trad
sn: Trad
givenName: george
mail: george.Trad
displayName: george Trad

I want to replace the sn=major instead sn=magor in cn=10 :

dn: cn=10
cn: denis.major
sn: major
givenName: denis
mail: denis.major
displayName: denis major

I want to add the telephoneNumber: 1.800.111.1111 and replace sn: golddd instead sn: gold in cn=12:

dn: cn=12
cn: samy.gold
sn: gold
givenName: samy
mail: samy.gold
displayName: samy gold
telephoneNumber: 1.800.111.1111

I want to replace the cn: irea.gord instead cn: irena.gord and mail: irea.gord instead mail: irena.gord in cn=13 :

dn: cn=13
cn: irena.gord
sn: gord
givenName: irena
mail: irena.gord
displayName: irena gord

I want to delete the follwing field givenName: John in cn=14:

dn: cn=14
cn: stuff
sn: Stuff
mail: stuff
displayName: Stuff

I need to create three files where I put the new added entries in new_entries_file.ldif, the deleted entries in deleted_entries_file.ldif and the modified entries in modified_entries_file.ldif. I want to run ldapmodify, ldapadd and ldapdelete.

Is the following content of modified_entries_file.ldif correct?
===========
cat modified_entries_file.ldif

dn: cn=10
changetype: modify
replace: sn
sn: major

dn: cn=12
changetype: modify
add: telephonenumber
telephonenumber: 1.800.111.1111
-
replace: sn
sn: gold

dn: cn=13
changetype: modify
replace: cn
cn: irena.gord
mail: irena.gord

dn: cn=14
changetype: modify
delete: givenName
=========

Is this following comamnd correct?

ldapmodify -D "cn=Directory Manager" -w password -h localhost -f modified_entries_file.ldif

Is the following content of new_entries_file.ldif correct?
===========
#cat new_entries_file.ldif

dn: cn=20
changetype: add
cn: jean.paul
sn: Paul
givenName: jean
mail: jean.paul
displayName: jean paul

dn: cn=21
changetype: add
cn: Gilles.paul
sn: Paul
givenName: Gilles
mail: Gilles.paul
displayName: Gilles paul
===========

Is this following comamnd correct?

ldapadd -D "cn=Directory Manager" -w password -h localhost -f new_entries_file.ldif

Is the following content of delete_entries_file.ldif correct?
===========
#cat delete_entries_file.ldif

dn: cn=40
changetype: delete

dn: cn=41
changetype: delete
===========

Is this following comamnd correct?

ldapdelete -D "cn=Directory Manager" -w password -h localhost -f deleted_entries_file.ldif


Can someone help me to create these 3 files and get 3 commands with their options?

Thanks a lot for your help,

Imad77

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsDatabasesLDAP Programming > Check LDAP commands and LDIF files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT