Managing directory attributes and values Red Hat Directory Server 12 Managing directory entries using ldapadd, ldapmodify, ldapdelete, and dsconf utilities or web console Red Hat Customer Content Services

Commands:
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=people,dc=example,dc=com changetype: modify delete: telephoneNumber - add: manager manager: cn=manager_name,ou=people,dc=example,dc=com modifying entry "uid=user,ou=people,dc=example,dc=com" ^D
command_that_outputs_LDIF | ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x
dn: uid=user,ou=people,dc=example,dc=com changetype: modify delete: telephoneNumber - add: manager manager: cn=manager_name,ou=people,dc=example,dc=com
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x -f ~/example.ldif
ldpamodify -c -D " cn=Directory Manager " -W -H ldap://server.example.com -x
ldapadd -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com uid: user givenName: given_name objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetorgperson sn: surname cn: user
ldapmodify -a -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com uid: user givenName: given_name objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetorgperson sn: surname cn: user
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: dc=example,dc=com changetype: add objectClass: top objectClass: domain dc: example
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com changetype: modify add: telephoneNumber telephoneNumber: 555-1234567
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com changetype: modify add: telephoneNumber telephoneNumber: 555-1234567 telephoneNumber: 555-7654321
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com changetype: modify replace: manager manager: uid=manager_name,ou=People,dc=example,dc=com
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com changetype: modify delete: telephoneNumber telephoneNumber: 555-1234567 - add: telephoneNumber telephoneNumber: 555-9876543
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com changetype: modify delete: manager
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com changetype: modify delete: telephoneNumber telephoneNumber: 555-1234567
The following rename operations exist:
dn: cn=new_group,ou=Groups,dc=example,dc=com objectClass: top objectClass: groupOfUniqueNames cn: old_group cn: new_group
dn: cn=new_group,ou=Groups,dc=example,dc=com objectClass: top objectClass: groupofuniquenames cn: new_group
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: cn=demo1,dc=example,dc=com changetype: modrdn newrdn: cn=demo2 deleteOldRDN: 1
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: cn=demo,ou=Germany,dc=example,dc=com changetype: modrdn newrdn: cn=demo newSuperior: ou=France,dc=example,dc=com deleteOldRDN: 1
ldapdelete -D " cn=Directory Manager " -W -H ldap://server.example.com -x " uid=user,ou=People,dc=example,dc=com "
ldapdelete -D " cn=Directory Manager " -W -H ldap://server.example.com -x " uid=user1,ou=People,dc=example,dc=com " " uid=user2,ou=People,dc=example,dc=com "
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com changetype: delete
ldapmodify -a -D " cn=Directory Manager " -W -H ldap://server.example.com -x
ldapmodify -a -D " cn=uid=user,ou=People,dc=example.com Chicago\, IL " -W -H ldap://server.example.com -x
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com changetype: modify add: jpegPhoto jpegPhoto:< file: ///home/user_name/photo.jpg
ldapmodify -D " cn=Directory Manager " -W -H ldap://server.example.com -x dn: uid=user,ou=People,dc=example,dc=com changetype: modify replace: homePostalAddress; lang-fr homePostalAddress; lang-fr : 34 rue de Seine
ldapmodify -D "cn=Directory Manager" -W -x dn: uid=jsmith,ou=people,dc=example,dc=com changetype: add objectClass: top objectClass: person objectClass: posixAccount uid: jsmith *cn: John Smith uidNumber: 0 gidNumber: 0
ldapmodify -D "cn=Directory Manager" -W -H ldap:// server.example.com -x dn: uid=jsmith,ou=people,dc=example,dc=com changetype: modify add: uidNumber uidNumber: 0 - add:gidNumber gidNumber: 0
ldapmodify -D "cn=Directory Manager" -W -H ldap:// server.example.com -x dn: uid=jsmith,ou=people,dc=example,dc=com changetype: modify add: uidNumber idNumber: 0 ^D ldapmodify -D "cn=Directory Manager" -W -H ldap:// server.example.com -x dn: uid=jsmith,ou=people,dc=example,dc=com changetype: modify add: employeeId employeeId: magic
dn: cn=Account UIDs,cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config objectClass: top objectClass: dnaPluginConfig cn: Account UIDs dnatype: uidNumber dnafilter: (objectclass=posixAccount) dnascope: ou=people,dc=example,dc=com dnaNextValue: 1
dn: cn=Account UIDs,cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config objectClass: top objectClass: dnaPluginConfig cn: Account UIDs dnatype: uidNumber dnafilter: (objectclass=posixAccount) dnascope: ou=people,dc=example,dc=com dnanextvalue: 1 dnaMaxValue: 1300 dnasharedcfgdn: cn=Account UIDs,ou=ranges,dc=example,dc=com dnathreshold: 100 dnaRangeRequestTimeout: 60 dnaNextRange: 1301-2301
dn: dnaHostname=ldap1.example.com+dnaPortNum=389,cn=Account UIDs,ou=Ranges,dc=example,dc=com objectClass: dnaSharedConfig objectClass: top dnahostname: ldap1.example.com dnaPortNum: 389 dnaSecurePortNum: 636 dnaRemainingValues: 1000
dsconf -D "cn=Directory Manager" instance_name plugin dna config "Account UIDs" add --type uidNumber --filter "(objectclass=posixAccount)" --scope ou=People,dc=example,dc=com --next-value 1 --max-value 1300 --shared-config-entry "cn=Account UIDs,ou=Ranges,dc=example,dc=com" --threshold 100 --range-request-timeout 60 --magic-regen 99999 Successfully created the cn=Account UIDs,cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config
ldapmodify -D "cn=Directory Manager" -W -H ldap:// server.example.com -x dn: ou=Ranges,dc=example,dc=com changetype: add objectclass: top objectclass: extensibleObject objectclass: organizationalUnit ou: Ranges - dn: cn=Account UIDs,ou=Ranges,dc=example,dc=com changetype: add objectclass: top objectclass: extensibleObject cn: Account UIDs
dsconf -D "cn=Directory Manager" instance_name plugin dna enable Enabled plugin 'Distributed Numeric Assignment Plugin'
dsconf -D "cn=Directory Manager" instance_name plugin dna config "Account UIDs" show dn: cn=Account UIDs,cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config cn: Account UIDs dnaFilter: "(objectclass=posixAccount)" dnaInterval: 1 dnaMagicRegen: 99999 dnaMaxValue: 1300 dnaNextValue: 1 dnaRangeRequestTimeout: 60 dnaScope: ou=People,dc=example,dc=com dnaSharedCfgDN: cn=Account UIDs,ou=Ranges,dc=example,dc=com dnaThreshold: 100 dnaType: uidNumber objectClass: top objectClass: dnaPluginConfig
uniqueness-attribute-name: mail uniqueness-subtrees: ou=accounting,dc=example,dc=com uniqueness-subtrees: ou=sales,dc=example,dc=com uniqueness-across-all-subtrees: on uniqueness-exclude-subtrees: ou=private,ou=people,dc=example,dc=com
uniqueness-attribute-name: mail uniqueness-top-entry-oc: nsContainer uniqueness-subtree-entries-oc: inetOrgPerson uniqueness-exclude-subtrees: ou=private,ou=people,dc=example,dc=com
dsconf -D "cn=Directory Manager" ldap:// server.example.com plugin attr-uniq add "Mail Uniqueness" --attr-name mail --subtree ou=sales,dc=example,dc=com ou=accounting,dc=example,dc=com
dsconf -D "cn=Directory Manager" ldap:// server.example.com plugin attr-uniq set "Mail Uniqueness" --across-all-subtrees on
ldapmodify -D "cn=Directory Manager" -W -H ldap:// server.example.com -x dn: cn=Mail Uniqueness,cn=plugins,cn=config changetype: modify add: uniqueness-exclude-subtrees uniqueness-exclude-subtrees: ou=internal,ou=sales,dc=example,dc=com
dsconf -D "cn=Directory Manager" ldap:// server.example.com plugin attr-uniq set "Mail Uniqueness" --subtree-entries-oc=inetOrgPerson
dsconf -D "cn=Directory Manager" ldap:// server.example.com plugin attr-uniq enable "Mail Uniqueness"
dsctl instance_name restart
dsconf -D "cn=Directory Manager" ldap:// server.example.com plugin attr-uniq show "Mail Uniqueness" dn: cn=Mail Uniqueness,cn=plugins,cn=config cn: Mail Uniqueness nsslapd-plugin-depends-on-type: database nsslapd-pluginDescription: Enforce unique attribute values nsslapd-pluginEnabled: on uniqueness-across-all-subtrees: on uniqueness-attribute-name: mail uniqueness-exclude-subtrees: ou=internal,ou=sales,dc=example,dc=com uniqueness-subtree-entries-oc: inetOrgPerson uniqueness-subtrees: ou=accounting,dc=example,dc=com uniqueness-subtrees: ou=sales,dc=example,dc=com
dsconf -D "cn=Directory Manager" ldap:// server.example.com plugin attr-uniq add "Mail Uniqueness with OC" --attr-name mail --subtree-entries-oc=inetOrgPerson --top-entry-oc=nsContainer
ldapmodify -D "cn=Directory Manager" -W -H ldap:// server.example.com -x dn: cn=Mail Uniqueness with OC,cn=plugins,cn=config changetype: modify add: uniqueness-exclude-subtrees uniqueness-exclude-subtrees: ou=internal,ou=sales,dc=example,dc=com
dsconf -D "cn=Directory Manager" ldap://server.example.com plugin attr-uniq enable "Mail Uniqueness with OC"
dsctl instance_name restart
dsconf -D "cn=Directory Manager" ldap:// server.example.com plugin attr-uniq show "Mail Uniqueness with OC" dn: cn=Mail Uniqueness with OC,cn=plugins,cn=config cn: Mail Uniqueness with OC nsslapd-plugin-depends-on-type: database nsslapd-pluginDescription: none nsslapd-pluginEnabled: on uniqueness-attribute-name: mail uniqueness-exclude-subtrees: ou=internal,ou=sales,dc=example,dc=com uniqueness-subtree-entries-oc: inetOrgPerson uniqueness-top-entry-oc: nsContainer