使用ldapdelete删除域

根据ldapdelete的手册页,应该可以删除条目

[root@controller ~]# man ldapdelete EXAMPLE The following command: ldapdelete "cn=Delete Me,dc=example,dc=com" will attempt to delete the entry named "cn=Delete Me,dc=exam‐ ple,dc=com". Of course it would probably be necessary to supply authentication credentials. 

但删除域不起作用:

 [root@controller ~]# ldapdelete -x -D "cn=Manager,dc=my-domain,dc=com" -W "dc=my-domain,dc=com" Enter LDAP Password: ldap_delete: No such object (32) 

而它的存在

 [root@controller ~]# ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts # extended LDIF # # LDAPv3 # base <> with scope baseObject # filter: (objectclass=*) # requesting: namingContexts # # dn: namingContexts: dc=my-domain,dc=com # search result search: 2 result: 0 Success # numResponses: 2 # numEntries: 1 

即使删除基本条目也不会删除命名上下文。 你必须从你的configuration中删除它。