Not sure if you still need help with this but recently i've had to create code to log intranet users on to our site automatically using windows authentication which is run using IIS. When using windows authentication and ISS in order obtain the logged in user firstly ensure you have windows authentication enabled and anonymous disabled.
$_SERVER['AUTH_USER']; // obtain the LanID of the logged in user.
If you require more info let me know.