Hi!
With the code below I get all the naming contexts that are configured on LDAP. My question is, how can I add a new naming context (eg. c=fr)? If it's possible, can you show me how can it be done? Thank you.
The result isCode:public List getNamingContexts() throws Exception { List list = ldapTemplate.search("", "(objectclass=*)", SearchControls.OBJECT_SCOPE, new String[] { "namingContexts" }, new AbstractContextMapper() { protected Object doMapFromContext(DirContextOperations ctx) { return ctx.getStringAttributes("namingContexts"); } }); return list; }
Code:Naming Context: [CN=SCHEMA, CN=CONFIGURATION, CN=LOCALHOST, CN=PWDPOLICY, CN=IBMPOLICIES, C=AU, DC=COM]


Reply With Quote
