Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Windows User identity

Status
Not open for further replies.

vilrbn

Programmer
Oct 29, 2002
105
FR
Hello,

My IIS Server is configurated as follows:

Anonymous access with IUSR_Name account,
Integrated Windows authentication.

I am tracking user activity on each page. To get his Windows user id, I tried several things:

Request.ServerVariables("LOGON_USER")
Request.ServerVariables("AUTH_USER")

Dim Ident As WindowsIdentity
_User = Ident.GetCurrent.Name()

Using ServerVariables, it's only working on my localhost and is set to blank for other users.
Using WindowsIdentity, I'm getting the anonymous account of my site (IUSR_Name) for other users.

Can you help me to find the Windows account of my user?

Thanks
 
Finally I find the solution...

I just had to configure thw Web.Config file as follows:

<authentication mode=&quot;Windows&quot; />

<authorization>
<deny users=&quot;?&quot; />
</authorization>

and now, using HttpContext.Current.User.Identity.Name I can get the user lan and name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top