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

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

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. Matthew Louden
    Replies:
    4
    Views:
    3,323
    Fahad Al Hadhrami
    Nov 24, 2003
  2. Joeri KUMBRUCK
    Replies:
    1
    Views:
    4,729
    Ben Lovell
    Aug 30, 2004
  3. Joeri KUMBRUCK

    ASP page to validate username with AD

    Joeri KUMBRUCK, Aug 31, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,640
    Joeri KUMBRUCK
    Aug 31, 2004
  4. Dica
    Replies:
    2
    Views:
    737
  5. Benny Ng
    Replies:
    1
    Views:
    686
    bruce barker
    Jan 4, 2007
  6. Matthew Louden

    how ASP.NET page gets user input from another ASP.NET page??

    Matthew Louden, Nov 22, 2003, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    323
    Fahad Al Hadhrami
    Nov 24, 2003
  7. Shailesh Patel
    Replies:
    0
    Views:
    622
    Shailesh Patel
    Nov 8, 2006
  8. Joeri KUMBRUCK
    Replies:
    4
    Views:
    444
    Joeri KUMBRUCK
    Sep 1, 2004
Loading...