Minimum permission for the Username to be able to connect to active directory using DirectoryEntry

john john 946 Reputation points
2022-10-14T09:26:44.08+00:00

We are connecting to Active Directory using this code, inside our ASP.NET MVC-5:-

                    string ADusername = System.Web.Configuration.WebConfigurationManager.AppSettings["ADUserName"];  
                    string ADpassword = System.Web.Configuration.WebConfigurationManager.AppSettings["ADPassword"];  
                    using (var context = new DirectoryEntry("LDAP://mydomain.com:389/DC=mydomain,DC=com", ADusername, ADpassword))  
  

now at the beginning the thought that username/password we are specifying inside the DirectoryEntry should be a active directory admin, to be able to get the users' info, but if i try to pass a non-admin user i am able to get all the users' info as well.. so my question is; What is the minimum permission for the Username to be able to connect to active directory using DirectoryEntry ?

Thanks

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,319 questions
{count} votes