Obtain user name and password from Active Directory

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?
Who is Participating?
RiteshShahConnect With a Mentor Commented:
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.




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

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

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...)
RETAILREALMAuthor Commented:
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.
snusgubbenConnect With a Mentor Commented:
You can't pull the passwords. They are hashes and it would be a huge security hole if it was possible!

AmericomConnect With a Mentor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.