How can I display the name of the logged in user

S

Sam

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

Henning Krause [MVP - Exchange]

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
 
S

Sam

Dear Henning and Manish,

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

Thank you.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top