Announcement Announcement Module
Collapse
No announcement yet.
Add new naming context Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add new naming context

    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.
    Code:
    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;
    }
    The result is
    Code:
    Naming Context: [CN=SCHEMA, CN=CONFIGURATION, CN=LOCALHOST, CN=PWDPOLICY, CN=IBMPOLICIES,
    C=AU, DC=COM]
Working...
X