I can"t get a Username in classic ASP

I can"t get a Username in classic ASP

am 03.01.2007 14:41:02 von dany

Hi, I'm trying to get the username of users in my intranet, using the
request.servervariables("LOGON_USER") command in classic ASP, but I get
nothing, not even an error message.

the basic script looks something like this:

------------------------------------------------------
dim chUser

chUser=request.servervariables("LOGON_USER")

response.write chUser

------------------------------------------------------

my IIS server is a Windows 2003 machine.

Thanks,

-Dany

Re: I can"t get a Username in classic ASP

am 03.01.2007 15:11:53 von reb01501

Dany wrote:
> Hi, I'm trying to get the username of users in my intranet, using the
> request.servervariables("LOGON_USER") command in classic ASP, but I
> get nothing, not even an error message.
>
> the basic script looks something like this:
>
> ------------------------------------------------------
> dim chUser
>
> chUser=request.servervariables("LOGON_USER")
>
> response.write chUser
>
> ------------------------------------------------------
>
> my IIS server is a Windows 2003 machine.
>
This is the symptom when the website has Anonymous Access enabled. Use
IIS Manager to disable Anonymous Access

--
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.

Re: I can"t get a Username in classic ASP

am 06.01.2007 14:07:00 von dany

Thanks for the tip.

I've tried it, but it doesn't seem to be working.


"Bob Barrows [MVP]" wrote:

> Dany wrote:
> > Hi, I'm trying to get the username of users in my intranet, using the
> > request.servervariables("LOGON_USER") command in classic ASP, but I
> > get nothing, not even an error message.
> >
> > the basic script looks something like this:
> >
> > ------------------------------------------------------
> > dim chUser
> >
> > chUser=request.servervariables("LOGON_USER")
> >
> > response.write chUser
> >
> > ------------------------------------------------------
> >
> > my IIS server is a Windows 2003 machine.
> >
> This is the symptom when the website has Anonymous Access enabled. Use
> IIS Manager to disable Anonymous Access
>
> --
> 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.
>
>
>

Re: I can"t get a Username in classic ASP

am 06.01.2007 14:08:00 von dany

"Bob Barrows [MVP]" wrote:

> Dany wrote:
> > Hi, I'm trying to get the username of users in my intranet, using the
> > request.servervariables("LOGON_USER") command in classic ASP, but I
> > get nothing, not even an error message.
> >
> > the basic script looks something like this:
> >
> > ------------------------------------------------------
> > dim chUser
> >
> > chUser=request.servervariables("LOGON_USER")
> >
> > response.write chUser
> >
> > ------------------------------------------------------
> >
> > my IIS server is a Windows 2003 machine.
> >
> This is the symptom when the website has Anonymous Access enabled. Use
> IIS Manager to disable Anonymous Access
>
> --
> 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.
>
>
>

Re: I can"t get a Username in classic ASP

am 06.01.2007 14:24:36 von reb01501

It's never failed for me.
Without being able to look at your website properties first-hand, I'm afraid
I can be of no furhter help.
Dany wrote:
> Thanks for the tip.
>
> I've tried it, but it doesn't seem to be working.
>
>
> "Bob Barrows [MVP]" wrote:
>
>> Dany wrote:
>>> Hi, I'm trying to get the username of users in my intranet, using
>>> the request.servervariables("LOGON_USER") command in classic ASP,
>>> but I get nothing, not even an error message.
>>>
>>> the basic script looks something like this:
>>>
>>> ------------------------------------------------------
>>> dim chUser
>>>
>>> chUser=request.servervariables("LOGON_USER")
>>>
>>> response.write chUser
>>>
>>> ------------------------------------------------------
>>>
>>> my IIS server is a Windows 2003 machine.
>>>
>> This is the symptom when the website has Anonymous Access enabled.
>> Use IIS Manager to disable Anonymous Access
>>
>> --
>> 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.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: I can"t get a Username in classic ASP

am 01.02.2007 12:06:38 von John Blessing

"Dany" wrote in message
news:3BD85A62-35A4-4E89-BC37-5C6160F571FD@microsoft.com...
>
>
> "Bob Barrows [MVP]" wrote:
>
>> Dany wrote:
>> > Hi, I'm trying to get the username of users in my intranet, using the
>> > request.servervariables("LOGON_USER") command in classic ASP, but I
>> > get nothing, not even an error message.
>> >
>> > the basic script looks something like this:
>> >
>> > ------------------------------------------------------
>> > dim chUser
>> >
>> > chUser=request.servervariables("LOGON_USER")
>> >
>> > response.write chUser
>> >
>> > ------------------------------------------------------
>> >
>> > my IIS server is a Windows 2003 machine.
>> >
>> This is the symptom when the website has Anonymous Access enabled. Use
>> IIS Manager to disable Anonymous Access
>>
>> --
>> 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.
>>


I agree with Bob that this is normally a symptom of anonymous
authentication. Are you sure you **disabled** anonymous authentication - not
just enabled windows authentication?

If you are, I also find it useful when using response.write for debugging
purposes to do:

Response.write "XXXX" & chUser & "YYYY"

It makes it easier to spot the output on a busy screen, but more
importantly, if I still see no output, I know there is an additional problem
with my code.

Also try doing :

on error resume next
chUser=request.servervariables("LOGON_USER")
Response.write "XXXX" & chUser & "YYYY"

If err.number <> 0 then
Response.write "
Response.write "
Error number " & Err.number & " " & Err.description
err.clear
end if

--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace,
send newsletters