Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   How to get the Windows current logged user name using ASP (http://www.velocityreviews.com/forums/t801267-how-to-get-the-windows-current-logged-user-name-using-asp.html)

mvr 05-16-2006 05:20 PM

How to get the Windows current logged user name using ASP
 
Hi all

How to get the Windows current logged user name using Classic ASP.
If no direct way are there any work arounds.

Thanks
mvr



Bob Barrows [MVP] 05-16-2006 05:33 PM

Re: How to get the Windows current logged user name using ASP
 
mvr wrote:
> Hi all
>
> How to get the Windows current logged user name using Classic
> ASP. If no direct way are there any work arounds.
>

1. Turn off Anonymous access to your site using IIS Manager
2. Use the LOGON_USER servervariable:
<%
response.write request.servervariables("LOGON_USER")
%>

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Aaron Bertrand [SQL Server MVP] 05-16-2006 05:35 PM

Re: How to get the Windows current logged user name using ASP
 
If you have one person logged onto the console directly, and two people
logged in through terminal services, what do you want to see? You can
probably hook into ADSI or use WScript.Network, but I think it will require
significantly elevated privileges (typically not recommended for a classic
ASP application).

One possible workaround is to use a data store for this, and have a login
script in the startup folder that stores %USERNAME% in a table. It will be
tougher to detect logoffs and inactive/expired sessions, of course.



"mvr" <v_enkat@hotmail.com> wrote in message
news:uOESI0QeGHA.3900@TK2MSFTNGP05.phx.gbl...
> Hi all
>
> How to get the Windows current logged user name using Classic ASP.
> If no direct way are there any work arounds.
>
> Thanks
> mvr
>
>




Aaron Bertrand [SQL Server MVP] 05-16-2006 05:44 PM

Re: How to get the Windows current logged user name using ASP
 
Silly me, I was thinking the user logged onto the machine, not the user
requesting the web page.



"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:ex7VO7QeGHA.3364@TK2MSFTNGP05.phx.gbl...
> mvr wrote:
>> Hi all
>>
>> How to get the Windows current logged user name using Classic
>> ASP. If no direct way are there any work arounds.
>>

> 1. Turn off Anonymous access to your site using IIS Manager
> 2. Use the LOGON_USER servervariable:
> <%
> response.write request.servervariables("LOGON_USER")
> %>
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>




Bob Barrows [MVP] 05-16-2006 06:41 PM

Re: How to get the Windows current logged user name using ASP
 
:-)
You're just a little out of practice

Aaron Bertrand [SQL Server MVP] wrote:
> Silly me, I was thinking the user logged onto the machine, not the
> user requesting the web page.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Aaron Bertrand [SQL Server MVP] 05-16-2006 06:44 PM

Re: How to get the Windows current logged user name using ASP
 
I know, what on earth am I doing here, anyway...


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:OvtsShReGHA.2188@TK2MSFTNGP04.phx.gbl...
> :-)
> You're just a little out of practice





All times are GMT. The time now is 11:08 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.