Retrieve Domain Information

T

tjonsek

am trying to pull the user logon info in an 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\ASPNET' when I am really wanting
'domain\sallyJ'.


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

agapeton

Sounds like you don't have impersonalization on. Using this makes the
service look like its running at the user so you can do stuff like
that.

Try this in your web.config file...
<system.web>
<identity impersonate="true" />
</system.web>
 
T

tjonsek

Thanks. I'm trying to read up on authentication and have just come
across that term. I'll try it and post back in case someone else has a
similar problem later.
 
T

tjonsek

I did it and got this result. 'machinename\IUSER_machinename'

Closer, but I think there is another setting I need to learn about and
implement.
 
T

tjonsek

Could this be due to a configuration setting in IIS? If so, what do I
need to be looking for?
Thanks
 
P

Patrick.O.Ige

Another thing tjonsek is do you have Integrated windows Auth checked in IIS
and Anonymouse Access unchecked
Patrick
 

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,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top