I\'m trying to synchronize OpenLDAP and Active directory together. To do so I\'m using a program called LSC-Project which is specified to do this sort of thing.
I have
The baseDn
should be the distinguished name of the base object of the search, for example, ou=users,dc=domname,dc=com
.
In Active Directory: Users
catalog is container
class, not OrganizationalUnit, so you should use: cn=users,dc=domname,dc=com
In case of Spring-ldap, we used to get this error when we specify the baseDn in the context file(LdapContextSource bean) and also in createUser code to build userDn.we need not specify the dc again in the buildUserDn()
protected Name buildUserDn(String userName) {
DistinguishedName dn = new DistinguishedName();
//only cn is required as the base dn is already specified in context file
dn.add("cn", userName);
return dn;
}
The main reason for NameNotFoundException
is that the object which you're searching doesn't exist or the container in which you are searching is not correct.