Getting the User Name of the logged in user - Community Credit Forums
in

    Community Credit Forums

Getting the User Name of the logged in user

Last post Sun, Mar 30 2008 4:23 AM by deepak kumarvasudevan. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • Sat, Feb 16 2008 1:48 AM

    Getting the User Name of the logged in user

    I want to know the user name of the logged in user from the AD or Windows.

     

    Currently I am using

     

    HttpContext.Current.User.Identity.Name.ToString();

     

    But using this I can only get the ID – eg: phanindra_palepu as output but not my full name.

     

    Can anyone suggest how can I get the full name (eg: Phanindra Prem Kumar)
    Filed under:
  • Sun, Feb 17 2008 10:48 AM In reply to

    Re: Getting the User Name of the logged in user

    Kumar,

    I assume that this application is an Intranet application and that you are using Windows Authentication as opposed to Forms Authentication.

    You will need to execute a query into Active Directory.

    I Googled the following words:  VB.NET active directory user name lookup

    This is a great article that covers interacting with Active Directory.  It has some very simple examples and what you are looking for.

    http://www.dreamincode.net/forums/showtopic30894.htm

    http://www.vbdotnetheaven.com/UploadFile/ecabral/ADandNETInVB11112005020216AM/ADandNETInVB.aspx

    You should be good to go.

     

     

     

     

    Cheers,

    Karl

    Code Project MVP, Karl's Blog : Get Mole v4 Here also!

    Just a grain of sand on the worlds beaches.
  • Sun, Mar 30 2008 4:23 AM In reply to

    Re: Getting the User Name of the logged in user

    Did you inspect the ServerVariable collections?

    ----
    Deepak K Vasudevan
    Architect
    http://deepakvasudevan.blogspot.com/
    http://www.lavanyadeepak.tk/
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems