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?
RETAILREALMAsked:
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.

http://blogs.officezealot.com/mauro/archive/2007/10/25/20607.aspx

http://www.kodyaz.com/articles/active-directory-services-queries-using-openquery.aspx

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_22997472.html

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

http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSectionID=1
0
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.

 
mvgeertruyenCommented:
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...)
0
 
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.
0
 
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!


SG
0
 
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.
0
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.