views:

62

answers:

1

I want to get currently logged in active directory user name/details.

Here, User does log in to machine with its AD username and password. How can i get this user name and other details in Global.asax file for Application_AuthenticateRequest() Event.

I have used System.Security.Principal.WindowsIdentity.GetCurrent().Name OR HttpContext.User.Identity.Name, it gives proper AD User. But, when it hosted on IIS 6.0 or 5.0 returns Server's users credentials. such as "domain\username". I have currently enabled Anonymous Access and Integrated Authentication. And in project using Form Authentication.

Should I use System.Directory.dll

One More Thing, I am using personalization setting in my application, If I changed it to Windows Authentication, it gives error "Personalization not enabled" and when I change it to Form Authentication in Application, it works but again restores IIS user name provided that Anonymous is Enabled. If I disable it It ask for user name and password for accessing application that I don't want.

Any help greatly anticipated

A: 

Have a look at this useful topic http://support.microsoft.com/kb/326340

Muhammad Akhtar
thanks, but link provides all about Authenticating user with AD. I want already authenticated AD user name when he logged into machine with AD credentials..
Swapnil Fegade