Get windows username under IIS

Im trying to create a simple page, and at the top say
Welcome User

I would like to get the windows username and replace user in Welcome, so for example 'Welcome tcross'.

Reading some documents this should be easy as Im using PHP under IIS, so I should be able to use:-
	echo $_SERVER['AUTH_USER'];

Open in new window

But all I get is:-
Notice: Undefined index: REDIRECT_LOGON_USER in C:\inetpub\wwwroot\test.php on line 4

Notice: Undefined index: REDIRECT_AUTH_USER in C:\inetpub\wwwroot\test.php on line 5

Is there something Im missing? Is there something I need to enable in IIS?

Thank you
Who is Participating?
-CPG-Connect With a Mentor Commented:
check your folder permissions on the actual folders containing the data on your disc.  IIS is very particular about folder permissions.  Given that you ought to be securing within IIS it makes sense to set annomous access to the folders on the disc and then control permissions from within IIS.
Loganathan NatarajanLAMP DeveloperCommented:
did you enable Integrated windows authentication instead of anonymous access?
tonelm54Author Commented:
Ok, well that was my first mistake then. Installed it and it now works if I do it from the localhost and displays my username great. However if I access the page from different machines, I get:-
401 - Unauthorized: Access is denied due to invalid credentials.

Any ideas?

Thank you
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.