What are the security permissions required to list users in the active directory

System Features:

  • Infopath 2007 with C # code
  • Webservices
  • Active Directory

I need to get the username (first and last name) from the active directory, but the user does not have permission to read active directory lists.

What permissions are needed to enable the user to search for AD

I use code like this

 SearchResult result;
 using (DirectoryEntry de = new DirectoryEntry("LDAP://DC=contoso,DC=com,DC=au"))
 {
     DirectorySearcher search = new DirectorySearcher(de, (string.Format("(&(objectClass=user)(mailNickname={0}))",this.Application.User.UserName)));
     result = search.FindOne();
 }

I looked at creating a web service that receives the required information, but this seems redundant, but you need to get around that every possible user of the form must have the correct permissions

EDIT:
, , - infopath. - . , . , . , .

+3
2

DirectoryEntry , Active Directory, , - , , IUSR _...- -, , - IIS. , Active Directory.

:

  • Active Directory , DirectoryEntry de = new DirectoryEntry("LDAP://DC=contoso,DC=com,DC=au", "sa-username", "sa-password", AuthenticationTypes.Secure). , , .

  • IIS - (IIS 6+) - Active Directory.
+3

AD AD .

, , :

new DirectoryEntry("LDAP://CN=users,DC=contoso,DC=com,DC=au")

.

, , . , - ASP.NET AD.

+1

Source: https://habr.com/ru/post/1722388/


All Articles