Ive encountered a situation where I need to be able to search for a user by the name of the active directory. Ive tried to find the user in the properties of SPSite.Users, SPSite.AllUsers and SPSite.SiteUsers, but the user cannot be in any of these lists. For users who have received permission to a site through an active directory group that has been granted permission to the site, there is no listing for the user in the list of users, this is only an entry for the active directory group. Is there a way to find a user programmatically in SharePoint without directly querying the active directory through LDAP?
Ideally, I would like to find a mechanism that works for forms-based authentication and AD authentication, but I need to find a mechanism that works with AD authentication.
source share