Click here to Skip to main content
15,908,909 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey all,

I have been looking around for a while trying to find the answer for this but i've come up short each time. Basically what I have is a helpdesk app that I've built to quickly and easily unlock AD accounts and reset PW's as well as pull up information about a user. Currently I have to have a user log into the app with the credentials they already use to get onto the PC's here at work. I want them to be able to just open the utility and start using it instead of them having to re-enter their login info.

What I have tried:

Currently the users have to log into the utility with their network info - I store it in strings that I end up having to pass around the program to retrieve info. The utility works perfectly now but I'd like to remove the extra login process.
Posted

1 solution

The current Windows Login detail is accessible as follows;
C#
System.Security.Principal.WindowsIdentity userI = System.Security.Principal.WindowsIdentity.GetCurrent();

This will allow you to get their Username but the Users password is not accessible

[MSDN Reference - WindowsIdentity.GetCurrent]
 
Share this answer
 
Comments
Member 12317227 9-Feb-16 19:02pm    
sweet! thanks for the info

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900