Display username from AD in ASP/.NET page

Discussion in 'ASP .Net' started by VM, Sep 27, 2006.

  1. VM

    VM Guest

    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?
     
    VM, Sep 27, 2006
    #1
    1. Advertising

  2. 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?
    >
    >
    >
     
    =?Utf-8?B?WTJLUFJBQlU=?=, Sep 27, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jason via DotNetMonster.com

    computer username display

    jason via DotNetMonster.com, Jul 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,444
    Aaron Corcoran
    Jul 7, 2005
  2. Arvind R
    Replies:
    3
    Views:
    474
    Patrick.O.Ige
    Nov 19, 2005
  3. JJ
    Replies:
    1
    Views:
    317
  4. Shailesh Patel
    Replies:
    0
    Views:
    488
    Shailesh Patel
    Nov 8, 2006
  5. Bob Lin
    Replies:
    6
    Views:
    324
    Bob Lin
    Oct 29, 2003
Loading...

Share This Page