0
我需要一個LDAP查詢來檢索用戶有權訪問的所有組。 I'm使用Java,必須正確配置屬性(searchbase,searchFilter和searchCtls)由OU =團體,DC =域,DC如下LDAP查詢,檢索用戶有權訪問的所有組
String searchBase = "OU=Groups,DC=domain,DC=net";
String searchFilter = "(objectClass=*)";
String returnedAtts[] = { "tokenGroups" };
SearchControls searchCtls = new SearchControls();
searchCtls.setSearchScope(SearchControls.OBJECT_SCOPE);
searchCtls.setReturningAttributes(returnedAtts);
NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);