활성 디렉토리의 모든 속성을 어떻게 알 수 있습니까 ??LDAP + Java : 활성 디렉토리의 이름을 알 수있는 방법
"ou = People"과 같은 예를 보았지만 회사에서 특정한 "People"이름에 액세스하는 방법을 알지 못합니다. 나는 LDAP에 접근 할 수 없다 (또는 내가 어떻게 해야할지 모르겠다) 그래서 나는 내가 무엇을 넣어야하는지 모른다. ou=....
고마워요 후 넣어 Failed to bind to LDAP [LDAP: error code 1 - 000020D6: SvcErr: DSID-03100754, problem 5012 (DIR_ERROR), data 0 remaining name 'ou=Users'
은 어떻게 알 수있는 회사의 사용을 이름 :
DirContext ctx = null;
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://"+serverAddress+":389");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, DOMAIN+username);
env.put(Context.SECURITY_CREDENTIALS, password);
try {
ctx = new InitialDirContext(env);
Attributes matchAttrs = new BasicAttributes(true); // ignore attribute name case
matchAttrs.put(new BasicAttribute("mail", "[email protected]"));
Attributes attrs = ctx.getAttributes("");
// Search for objects that have those matching attributes
NamingEnumeration<SearchResult> answer = ctx.search("ou=Users", matchAttrs);
while (answer.hasMore()) {
SearchResult sr = (SearchResult)answer.next();
System.out.println(">>>" + sr.getName());
}
나는 오류를 가지고!