Groups | Blog | Home
all groups > asp.net security > june 2007 >

asp.net security : How can I display the name of the logged in user


Sam
6/12/2007 11:51:02 AM
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]
6/13/2007 12:10:38 AM
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

[quoted text, click to view]
Manish Bafna
6/13/2007 2:12:01 AM
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.



[quoted text, click to view]
Manish Bafna
6/13/2007 2:21:01 AM
Hi,
Also you would need to add reference to system.directoryservices.dll
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



[quoted text, click to view]
Sam
6/13/2007 11:21:01 AM
Dear Henning and Manish,

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

Thank you.


[quoted text, click to view]
AddThis Social Bookmark Button