简体   繁体   中英

Active Directory Query - Java

I have followed this example: http://myjeeva.com/querying-active-directory-using-java.html

my domain is mycompanyname.com.au I added this to avoid authentaction: properties.put(Context.SECURITY_AUTHENTICATION,"none"); I am searching for a username. However, I got this exception:

Apr 13, 2015 9:57:26 AM ldap.ActiveDirectory <init>
SEVERE: mycompany.com.au:port no
Exception in thread "main" java.lang.NullPointerException
    at ldap.ActiveDirectory.searchUser(ActiveDirectory.java:108)
    at ldap.N.main(N.java:65)

I am looking for a specific group of users which are in CN=XXXX,OU=Security IT,OU=IT,DC=mycomapny,DC=com,DC=au

There is space in OU=Security IT. Is it an issue?

The exception is thrown by

return this.dirContext.search(base, filter, this.searchCtls);

我发现此解决方案非常有效。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM