I am designing a web application using the ASP.net MVC framework. I would like to use Windows Authentication and do Role Checks using the Role Manager SQLRoleProvider.
How can I determine the email address of the current logged on user? Is this even possible?
The application will be deployed in a multi-domain intranet, if that matters (which I assume it does).
Thanks for any help!
Here is a sample from some code:
DirectorySearcher searcher = new DirectorySearcher();
searcher.Filter = string.Format("sAMAccountName={0}", _name);
SearchResult user = searcher.FindOne();
string emailAddr = user.Properties["mail"][0].ToString();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With