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
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
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
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