Retrieve Domain User Info

T

tjonsek

I am trying to pull the user logon info in an asp.net application to
use as a
security stamp when someone completes a function. So far, I am able to
retrieve the computer name. This is, however, not what I'm looking for.



For example, if Sally logs on to the domain as 'sallyJ', then I'd like
to be able to pull the logon 'sallyJ' when she clicks a button.


Here is the code I am using:


(Before declarations)
Imports System.Security
Imports System.Security.Principal.WindowsIdentity


IN a sub btnName_Click():
Dim user As String
user = GetCurrent.Name.ToString


So far, if 'sallyJ' logs onto the network and is using a PC named
'sally_PC', then I get 'sally_PC' when I am really wanting 'sallyJ'.


I appreciate any help or direction you can give me.
 
P

Patrick.O.Ige

tjonsek if the user is logged in and you are in a Domain environment
Then use :- User.Identity.Name
Hope that helps
Patrick
 
T

tjonsek

My problem was due to configuration settings in IIS. I did a little
research and found that security was set to allow anonymous users. I
changed this to require Integrated Domain Authentication and it worked
like a charm.
Thanks for your help.
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top