Active Directory

Posted on 2006-05-29
Last Modified: 2008-01-09
I need to write a login screen with validation by Active Directory but I am not sure how to do it. Would any kind experts please guide me how I can pass a userid and password to Active Directory to verify a user.

I've looked at a few sources such as:

but I can't find anything on userid and password validation.

Question by:delphikit
    LVL 28

    Expert Comment

    you could try and just log in using that user and pass. I took a look at the demo on that article and the button3 on bindigs demo does the job ;)

    Author Comment

    Hi ciuly,

    Thanks for pointing out the demo to me. I did played around with it. But why is it I can only verify my current user id and password and not others?

    If I tried using other userid and password besides my own I get this error:

    Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.

    If I tried using my own userid and password it shows me:

    I've changed the on click procedure to:

    procedure TForm1.Button3Click(Sender: TObject);
    var hr : integer;
        obj : IADs;
      hr := ADsOpenObject('WinNT://' + DOMAINNAME, edUserID.text, edPassword.text,
               ADS_PROMPT_CREDENTIALS , IADs, obj );
      if Succeeded(hr) then
         ShowMessage(obj.Name + ',' + obj.ADsPath);

    LVL 28

    Accepted Solution

    that is some policy on your domain that restricts one user to one logon session. mine has something like if you miss the password the account is locked for some period of time. and of course that when I tested the code... I used a bad password so to see that indeed it worked. guess what happened when I tried to log on correctly :)
    the best way to test such thing is using a test domain. those usually don't have much restrictions and you can do whatever you like. if you are in a software development company, then you must have some test domains (qa is usually using those)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
    This video discusses moving either the default database or any database to a new volume.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now