Obtain user name and password from Active Directory

Posted on 2009-04-23
Last Modified: 2012-08-13
I am writing a windows service in .Net which will check the current user logged into Active Directory. It will obtain teh user name and password from the active directory and then login to another 3 party program.
Can any one tell me if itis possible to obtain User Name and Password of the current user from active directory?
    LVL 31

    Expert Comment

    LVL 31

    Expert Comment

    this one is also a good resource, all you need to do is, use Microsoft script repository to access AD from your C#.
    LVL 6

    Expert Comment

    You can get the username but not the password - if you want this then you would need to use an off the shelf SSO application or write your own. (typically you would get the username of the logged on user and pass that to the 3rd party app in a secure way - in very simple terms...)

    Author Comment

    HI Ritesh,
    Thank you for the quick response. I am little short of time here. Let me ask a more specific question. and the links yo have given mostly refer to Windows 2000 Active directory.

    Do yoiu know any  code which can help me get the user name and password from the current user in Windows 2003 Active Directory? Retrieving the passwor id particularly important.
    LVL 31

    Accepted Solution

    well, I don't think so you will be able to retrieve password directly from AD. as long as my knowledge is concern, it is not possible.

    and user id concern, you can easily create linked server of your AD and execute simple query to list it in your C# application.

    LVL 21

    Assisted Solution

    You can't pull the passwords. They are hashes and it would be a huge security hole if it was possible!

    LVL 18

    Assisted Solution

    If your 3rd party program is ldap compatible, you should be able to configure the program to authenticate domain user from your Active Directory. If it's not, then it must uses its own database for user account authentication, then even you can get the domain user account and password it would be meaningless as password changes from time to time. Your other option is write your own script or have your 3rd party program developer to come up with compatibility to allow the 3rd party program to accpet ldap authentication from your domain.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Companies that have implemented Microsoft’s Active Directory need to ensure that the Active Directory is configured and operating properly. If there are issues found and not resolved, it eventually leads the components to fail or stop working and fi…
    Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    779 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

    16 Experts available now in Live!

    Get 1:1 Help Now