Fetching the Currently Logged in user Email RRS feed

  • Question

  • User1261861301 posted

    Hey Frnds,

    I am using the System.DirectoryServices.UserPrincipal.Current.EmailAddress to fetch the Currently logged in users email from AD.

    If  debug my sol am getting the Exact mail id of that Particular user for ex:john@in.domain.com.

    If i host My Application on iis

    And Access my App am getting some other Email id instead of the john@in.domain.com.

    I have changed the Application Pool identity to NetWorkService.

    Can any one tell what could be wrong




    Wednesday, February 3, 2010 4:21 AM

All replies

  • User-1602017767 posted

    Have you altered the settings in IIS to turn off 'Anonymous Access'? This enables the currently logged in user credentials to come through rather than the guest account details.

    If this doesn't work the other option is to retrieve the login ID from User.Identity.Name and then perform an LDAP query to retrieve the data your after.

    Tuesday, February 9, 2010 4:49 PM