Can anyone please help in getting the version of windows . I would like to check whether LDAP server is running on Windows 2003 to windows 2008.
Presumably you mean "Active Directory" which is what Microsoft calls their LDAP server.
If so ask on a microsoft forum. Probably two different questions. 1 - How to get it. 2 - What MS API calls to make.
Also is it possible to get the information using JNDI ?
Depends on the answer to the questions.
It also depends on exactly what you are using for JNDI since by itself that is just an interface/api and not an implementation.