Learn how to a build a cloud-first strategyRegister Now


Obtain user name and password from Active Directory

Posted on 2009-04-23
Medium Priority
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

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


Expert Comment

ID: 24214059
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...)
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks


Author Comment

ID: 24214159
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

RiteshShah earned 750 total points
ID: 24214181
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

snusgubben earned 300 total points
ID: 24214464
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

Americom earned 450 total points
ID: 24214960
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.

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

810 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