Re: How to get current logged in Windows username?

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Wed, 6 Apr 2005 16:14:41 -0700, Eltoon Wang wrote:

> Hi John,
>
> If you use Windows authentication and deny anonymous
> access, you can use HttpContext.Current.User.Identity.Name
> to get domain log on user name.


Now I am in a delimma. For HttpContext.Current.User.Identity.Name to work,
"anonymous access" needs to be turned off but I need the Intranet app run
under a domain user who has access to network shares. Otherwise if I have
intergrated Windows security used then I have to maintain all kinds of ntfs
permissions and probably all kinds of others issues which I can't think of
right now. Access to folders is maintained by the Intranet app.

John Dalberg





>>-----Original Message-----
>>
>>
>>I want to automate the process of logging into an
> intranet. I want to pull
>>out the username of the Windows user logged into the
> machine running the
>>browser and use the username in my app. How can I get the
> logged in
>>username?
>>
>>Do I have to disable the anonymous access in IIS? I
> rather not because the
>>site is running under a certain domain user which has
> access to certain
>>folder and network shares and the site needs thsi access
> for reading and
>>writing files.
>>
>>--
>>John Dalberg
>>.
>>


--
John Dalberg
.


Quantcast