Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Active Directory query

$
0
0

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.

 {

        string domainConnectionString ="LDAP://DC=Servername,dc=com";
      
        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
            }
        }



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>