How to read Windows logged in username with PHP/IIS

If you’ve set IIS to authenticate users one or more of these should contain the username:

$_SERVER['LOGON_USER']
$_SERVER['AUTH_USER']
$_SERVER['REDIRECT_LOGON_USER']
$_SERVER['REDIRECT_AUTH_USER']

Leave a Comment