I'm trying to write what should be a pretty straightforward little program. All I need to do is log into Active Directory, and ask "Does this username exist" or "does this group exist?"
I can authenticate and log in just fine using:
However, all the examples I find online use something similar to
for the login name. I have no idea what the CN and DC means or how you're supposed to know what it means. Plus... how is CN assigned two different values?
I've found examples for searching online, and they seem pretty straightforward. Below is one such example I have found.
1) How do you know what the names of the attributes are? Is there a standard? This program needs to run on any computer.
2) Same thing but with the searchFilter.
3) How are the attributes in returnedAtts different from the things in the search filter? For example, "mail" is used in both.
4) What is searchBase and why is it set to an empty
String?