Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How to get the Windows current logged user name using ASP

Reply
Thread Tools

How to get the Windows current logged user name using ASP

 
 
mvr
Guest
Posts: n/a
 
      05-16-2006
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


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      05-16-2006
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.


 
Reply With Quote
 
 
 
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      05-16-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      05-16-2006
Silly me, I was thinking the user logged onto the machine, not the user
requesting the web page.



"Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      05-16-2006

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.


 
Reply With Quote
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      05-16-2006
I know, what on earth am I doing here, anyway...


"Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> You're just a little out of practice



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Windows - Get current logged user Rodrigo Bermejo Ruby 13 10-23-2007 11:14 PM
LoginView does not show a logged in user as being logged in keithb ASP .Net 0 02-16-2006 05:20 PM
How can I get the current logged user information Shaminda Illangantilaka ASP .Net Security 2 01-25-2006 11:15 AM
Get the current logged in user name Imran Aziz ASP .Net Security 8 08-29-2005 03:54 AM



Advertisments