How can I display the name of the logged in user

Discussion in 'ASP .Net Security' started by Sam, Jun 12, 2007.

  1. Sam

    Sam Guest

    Dear Sir,

    Please; How can I display the name of the logged in user when I am using
    windows integrated security in my Windows forms application?I used
    My.User.Name but it displays the Login name only.

    Thank you.
    Sam, Jun 12, 2007
    #1
    1. Advertising

  2. Hello,

    you'll have to look it up. In a domain environment, you'll have to look at
    ActiveDirectory. You can do this either by performing LDAP query
    (http://www.infinitec.de/articles/exchange/findusermultiad.aspx). Another
    option is to bind to the user object directly by using Sid Binding (You'll
    have to obtain the SID first. In .NET 2.0 you can use the
    NTAccount(accountname).Translate(typeof(SecurityDescriptor)), see
    http://msdn2.microsoft.com/En-US/library/ms675562.aspx). And a third option
    is calling the DsCrackNames function via Interop.

    Best regards,
    Henning Krause

    "Sam" <> wrote in message
    news:...
    > Dear Sir,
    >
    > Please; How can I display the name of the logged in user when I am using
    > windows integrated security in my Windows forms application?I used
    > My.User.Name but it displays the Login name only.
    >
    > Thank you.
    >
    Henning Krause [MVP - Exchange], Jun 12, 2007
    #2
    1. Advertising

  3. Sam

    Manish Bafna Guest

    Hi,
    Below link provides solution to your query:
    http://www.pardesifashions.com/Softomatix/UserFullName.aspx
    --
    Hope this answers your question.
    Thanks and Regards.
    Manish Bafna.
    MCP and MCTS.



    "Sam" wrote:

    > Dear Sir,
    >
    > Please; How can I display the name of the logged in user when I am using
    > windows integrated security in my Windows forms application?I used
    > My.User.Name but it displays the Login name only.
    >
    > Thank you.
    >
    Manish Bafna, Jun 13, 2007
    #3
  4. Sam

    Manish Bafna Guest

    Hi,
    Also you would need to add reference to system.directoryservices.dll
    --
    Hope this helps.
    Thanks and Regards.
    Manish Bafna.
    MCP and MCTS.



    "Sam" wrote:

    > Dear Sir,
    >
    > Please; How can I display the name of the logged in user when I am using
    > windows integrated security in my Windows forms application?I used
    > My.User.Name but it displays the Login name only.
    >
    > Thank you.
    >
    Manish Bafna, Jun 13, 2007
    #4
  5. Sam

    Sam Guest

    Dear Henning and Manish,

    Thank you for your help and support. The information you provided was really
    helpful to me.

    Thank you.


    "Manish Bafna" wrote:

    > Hi,
    > Also you would need to add reference to system.directoryservices.dll
    > --
    > Hope this helps.
    > Thanks and Regards.
    > Manish Bafna.
    > MCP and MCTS.
    >
    >
    >
    > "Sam" wrote:
    >
    > > Dear Sir,
    > >
    > > Please; How can I display the name of the logged in user when I am using
    > > windows integrated security in my Windows forms application?I used
    > > My.User.Name but it displays the Login name only.
    > >
    > > Thank you.
    > >
    Sam, Jun 13, 2007
    #5
    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. Ganesh Ramamurthy

    Getting Logged in User Name

    Ganesh Ramamurthy, Dec 8, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,914
    Patrick Olurotimi Ige
    Dec 8, 2004
  2. keithb
    Replies:
    0
    Views:
    626
    keithb
    Feb 16, 2006
  3. Replies:
    1
    Views:
    939
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 12, 2007
  4. Learner
    Replies:
    0
    Views:
    123
    Learner
    Mar 7, 2006
  5. Replies:
    5
    Views:
    159
    Steve
    Mar 21, 2005
Loading...

Share This Page