Search code examples
javaapiactive-directoryrundll32

What does "rundll32 dsquery,OpenQueryWindow" return?


So I'm working on a project where I would like to be able to have the user browse the Active Directory to find a machine or workstation. I already know that you can envoke this directory search in the command prompt by using:

rundll32 dsquery,OpenQueryWindow

I'm using java for my project and I understand how to capture input from a command that I execute in the program but currently, at home, I'm not connected to a domain so I cannot test what the command returns when a user selects a computer or if it even returns anything. Could someone test this for me and tell me what it returns.

Also, if anyone has any better ideas on how to achieve this without relying on window's tools, like maybe a Java API for Active Directory Services?


Solution

  • Instead of calling an API function using rundll32, you should use a Java based LDAP library which will encapsulate the work in front of the Active Directory (so you won't have to parse the results by yourself).

    Also, if anyone has any better ideas on how to achieve this without relying on window's tools, like maybe a Java API for Active Directory Services?

    Choosing a pure Java library could help you run your application on many platforms (as opposed to using Windows' rundll32 which will limit you to Windows platform)

    Check out this thread: https://stackoverflow.com/questions/389746/ldap-java-library.

    currently, at home, I'm not connected to a domain so I cannot test what the command returns

    There are solutions for this kind of testing problems. You should read about mocking: http://en.wikipedia.org/wiki/Mock_object

    Good luck!

    Tal.