Show DisplayName from AD through

Vote:
 
Hi, Does anyone knows how to show the "DisplayName" from Active Directory in a EPiServer template. This only returns the login name (eg. MyDomain\StJa) string name = user.Identity.Name; But I would like to get the complete name which is stored in AD, in my case, "Stefan Jakobsson" Is this possible via the EPiServer API or do I need to write my own script for this? Thanks! //Stefan
#12225
Mar 25, 2008 18:34
Vote:
 
You need to write this code yourself. See the System.DirectoryServices namespace and the DirectoryEntry class for more information. /Steve
#13878
Mar 25, 2008 18:43
Vote:
 
Is it possible to import the information into EPiServer Users fra AD other than just the username? /per
#13879
Mar 25, 2008 18:43
Vote:
 
You could do a scheduled job that loops through the EPiServer user collection, finds the user in AD, and updates the EPiServer user with that information. You have to decide which fields to update, what to do with users that already have defined values (overwrite, keep, etc.) There are customers that have this in place already, so it is absolutely doable, you just need to know your way around AD and ADSI. /Steve
#13880
Mar 25, 2008 18:43
Vote:
 
Just found a relevant example on how do this on wwwcoder. See http://www.wwwcoder.com/main/Default.aspx?tabid=68&mid=407&site=1694&parentid=177 There are other articles on wwwcoder about AD that are interesting too: http://www.wwwcoder.com/main/parentid/260/site/2150/68/default.aspx (lots of examples.) Seems like most examples are vb.net, but they should be easy to convert. You can also do a search for "active directory asp.net" on www.codeproject.com for lots of good articles. /Steve
#13881
Mar 25, 2008 18:43
* 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.