Groups | Blog | Home
all groups > asp.net security > january 2004 >

asp.net security : ldap or active directory


Mike
1/29/2004 2:41:31 PM
In my current asp.net application i'm getting the user network short name
and displaying that on the screen. What I want is the users Full name and
display that instear. How can i go about doing that, would I use LDAP or
Active directory to do that?

I never had to do this and not sure how to do it or where to start looking.

Ex: this is what i get now.
jsmith - network logon ID

what I want is:
John Smith.

is this possible?

Joe Kaplan (MVP - ADSI)
1/29/2004 3:04:56 PM
You talk to Active Directory via LDAP (generally with
System.DirectoryServices using .NET), so the answer is likely to be both.

The basic idea would be to use the DirectorySearcher component to search
Active Directory based on the short name (probably the samAccountName
attribute) and return the DisplayName or whatever other attribute actually
has the full name in your directory.

There are some nice samples in MSDN and some good technotes on S.DS in
ASP.NET:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sds/sds/searching_the_directory.asp?frame=true
http://support.microsoft.com/default.aspx?scid=kb;en-us;329986

Joe K.

[quoted text, click to view]

AddThis Social Bookmark Button