Getting info from AD

Vote:
 

I'm working on a site where users authenticate via Active Directory. I can retrieve the users fullname via CurrentUser.Fullname or username via CurrentUser.UserName. That's pretty much it... I would like to retrieve the users e-mailadress as well... and maybe some other info. How can I go about getting this information out of the AD? The site is using CMS 6 R2. What would be the easiest way?

#73728
Aug 07, 2013 10:09
Vote:
 

Hi,

The easiest way is to use the methods in System.DirectoryServices, please see http://msdn.microsoft.com/en-us/library/system.directoryservices.aspx. And then fetch the user as an UserPrincipal, which will have all the properties. If you extend the UserPrincipal object you can get custom properties typed.

#73746
Aug 07, 2013 16:24
Vote:
 

I agree with Johan above. Using .NET standard System.DirectoryServices to retrieve additional information about the user is the way to go. Expensive operation so might want to store it in either session or by extending the current user yes...

#73747
Aug 07, 2013 17:27
Vote:
 

Thank you... Shall have a look at it!

#73783
Aug 09, 2013 10:19
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.