Example LDAP commands

From Brandonhutchinson.com

Revision as of 15:18, 19 September 2007 by Hutch (Talk | contribs)
Jump to: navigation, search

To list the password policy on Sun Directory Server 5.2 and later:

$ ldapsearch -h LDAP_server -D "cn=Directory Manager" -b "cn=Password Policy,cn=config" "objectClass=*"

To list LDAP client profiles on LDAP server:

$ ldapsearch -h LDAP_server -D "cn=Directory Manager" -b "ou=profile,dc=example,dc=com" "objectClass=*"

To delete an LDAP client profile named cn=default,ou=profile,dc=example,dc=com

  • Method 1 using ldapdelete
$ /usr/bin/printf "dn: cn=default,ou=profile,dc=example,dc=com\n" | ldapdelete -h LDAP_server -D "cn=Directory Manager"
  • Method 2 using ldapmodify
$ /usr/bin/printf "dn: cn=default,ou=profile,dc=example,dc=com\nchangetype: delete" | ldapmodify -h LDAP_server -D "cn=Directory Manager"
Personal tools