Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7434203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:47:53+00:00 2026-05-29T09:47:53+00:00

I need to connect to an external LDAP server that is accessible to me

  • 0

I need to connect to an external LDAP server that is accessible to me but only over LDAPS.

The information I have available is username, server, password. I need to query and retrieve a list of all users. The format I have the details in are

  • Username: domain\username
  • Password: {password}
  • Domain: remote.{domain}.net.au

The following code I wrote will authenticate my user account successfully, but I now need to enumerate all users which is where I’m having issues. Ideally this would be ALL users in the directory, not from within a specific OU. Again, I don’t have the fully qualified paths to any OUs for this server. The server has a self signed certificate which is why in my example I am specifically telling it to accept the certificate.

        int port = secured ? 636 : 389;

        LdapConnection connection = new LdapConnection(new LdapDirectoryIdentifier(ldapServer, port, false, false));

        if (secured)
        {
            connection.SessionOptions.ProtocolVersion = 3;
            connection.SessionOptions.SecureSocketLayer = true;
        }


        connection.Credential = new NetworkCredential(username, password);
        connection.AuthType = AuthType.Basic;
        connection.SessionOptions.VerifyServerCertificate += (conn, cert) => { return true; };
        connection.Bind();

        return connection;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:47:54+00:00Added an answer on May 29, 2026 at 9:47 am

    So the answer is in Performing a Simple Search sample of Introduction to System.DirectoryServices.Protocols (S.DS.P) with :

    // create a search filter to find all objects
    string ldapSearchFilter = "(&(objectCategory=person)(objectClass=user))";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need to connect to another server we manage and have it's results (in
I have a ASP.Net C# application that needs to connect to an external API
I am running a LAMP server but now need to connect to MS SQL
I need connect to server git. http://help.github.com/win-set-up-git/ I do everything to the point, 4
I need to connect Apache Axis 1.4 to a Webservice that uses NTLM authentication
I need to connect to SAP and do a simple update but it will
I need to connect to a SQL Server 2008 through PHP (WAMP, latest version).
I have a BSD socket created with following code (it's in external library that
I need to connect to some external databases from Magento. I found one tutorial
i need functionality like..connect android device to external usb device using RS232 interface. also

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.