|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Viewing: Dev Shed Forums > Databases > LDAP Programming > Check LDAP commands and LDIF files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|