I'm sure this will be quite complicated.

I have done some research into Java communicating with Active Directory and found this useful information:

OTN Discussion Forums : JNDI, Active...