need to retrieve data LDAP server, my AD account has no permission but <g class="gr_ gr_35 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="35" id="35">i</g> have username and password, Need to use username and password in the connection string. Here is code, this code works for some of the domain, where <g class="gr_ gr_293 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="293" id="293">i</g> have access but some don't, trying to pass username and password to connect.
{
using (DirectorySearcher ds = new DirectorySearcher(new DirectoryEntry(domainConnectionString)))
{
ds.Filter = "(&" +
"(objectClass=user)" +
")";
using (SearchResultCollection results = ds.FindAll())
{
// Loop through all rows of the search results
}
}