You can see in the following posts
http://forums.sun.com/thread.jspa?threadID=603815
http://forums.devshed.com/ldap-programming-76/active-directory-services-using-java-api-89586.html
an example of accessing LDAP using the InitialLdapContext
class in Java. This requires a login and a password to be passed in. (Even though the service account or user running the java process has already logged in to be able to run.)
As the user or service account is already logged in - they can already run active directory commands like the following without a user name or password:
dsquery user -samid "login" |dsget user -samid -email -display
So why does Java need the login and a password - if this query is already available to windows? Kosuke hints that it is not required in this blog post under conclusion:
http://weblogs.java.net/blog/kohsuke/archive/2008/06/more_active_dir.html
My question is - how can we call active directory in java without:
- using a login or password (running under an account that is already logged in)?
- executing a command on the command line?