If you're using active directory then write it using the LDAP extension fucntions.
You can also enable it through IIS by going to properties😃irectory Security:Enable anonymous access and edit the authentication methods for this resource-edit button:Check 'integrated windows authentication'.
There will then be a $GLOBAL var that has the user's login in it. Use phpinfo() to find it; don't know it off the top of my head