Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Display username from AD in ASP/.NET page

Reply
Thread Tools

Display username from AD in ASP/.NET page

 
 
VM
Guest
Posts: n/a
 
      09-27-2006
How can I pass a user's display name or first+last name (not the login name)
from their AD account in an ASP page?


 
Reply With Quote
 
 
 
 
=?Utf-8?B?WTJLUFJBQlU=?=
Guest
Posts: n/a
 
      09-27-2006
using System.Reflection;
using System.DirectoryServices;
....
DirectoryEntry ent = new DirectoryEntry("LDAP://CN=My
User,DC=Fabrikam,DC=com");
Object ads = ent.NativeObject;
Type type = ads.GetType();
String firstName = (string) type.InvokeMember("FirstName",
BindingFlags.GetProperty, null, ads, null);
String lastName = (string) type.InvokeMember("LastName",
BindingFlags.GetProperty, null, ads, null);
--
Y2KPRABU, MCP, INDIA
WEB APPS


"VM" wrote:

> How can I pass a user's display name or first+last name (not the login name)
> from their AD account in an ASP page?
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I have one ASP.NET Page. It's for display customer information. Now I want this page to handle the function "Edit" and "Display", Is it possible? Benny Ng ASP .Net 1 01-04-2007 08:00 PM
loginview control displays network username instead of (web) username Shailesh Patel ASP .Net Web Controls 0 11-08-2006 08:19 PM
Display (no's and username) logged in users! Arvind R ASP .Net 3 11-19-2005 11:12 AM
computer username display jason via DotNetMonster.com ASP .Net 3 07-07-2005 08:20 PM
Change the username found in "C:\Documents and Settings\Username" The Reluctant Robot Named Jude Computer Support 1 05-05-2004 07:11 AM



Advertisments