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 6549123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:03:16+00:00 2026-05-25T12:03:16+00:00

I have a problem connecting to my ldap. It keeps giving me a COMExceptionError

  • 0

I have a problem connecting to my ldap. It keeps giving me a COMExceptionError (The parameter is incorrect)

Here is the code i have so far:

static void Main(string[] args)
    {

        DirectoryEntry ldapConnection = new DirectoryEntry("10.9.130.113:667");
        ldapConnection.Path = "LDAP://ou=Users,ou=CorporateStore,ou=Absa,c=za";
        ldapConnection.AuthenticationType = AuthenticationTypes.Anonymous;

        DirectorySearcher ds = new DirectorySearcher(ldapConnection);
        SearchResult result = ds.FindOne();
        Console.ReadLine();
        if (result != null)
        {


            ResultPropertyCollection fields = result.Properties;

            foreach (String ldapField in fields.PropertyNames)
            {


                foreach (Object myCollection in fields[ldapField])
                    Console.WriteLine(String.Format("{0,-20} : {1}",
                                  ldapField, myCollection.ToString()));
                Console.ReadLine();
            }

This is the line the error occurs at:

SearchResult result = ds.findOne();

Heres the exception Error and stack trace:

System.Runtime.InteropServices.COMException was unhandled
  Message=The parameter is incorrect.

  Source=System.DirectoryServices
  ErrorCode=-2147024809
  StackTrace:
       at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
       at System.DirectoryServices.DirectoryEntry.Bind()
       at System.DirectoryServices.DirectoryEntry.get_AdsObject()
       at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
       at System.DirectoryServices.DirectorySearcher.FindOne()
       at LDAPConnector.Program.Main(String[] args) in c:\documents and settings\expn261\my documents\visual studio 2010\Projects\LDAPConnector\LDAPConnector\Program.cs:line 23
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

Any ideas?

  • 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-25T12:03:17+00:00Added an answer on May 25, 2026 at 12:03 pm

    It seems like you define different paths in the constructor to the DirectoryEntry and then override it by setting the Path property. If your server differ from the domain in the RDN you shall define it in the path. Can you try to do it in this way and see if you get a different error?

        DirectoryEntry ldapConnection = new DirectoryEntry("LDAP://10.9.130.113:667/ou=Users,ou=CorporateStore,ou=Absa,dc=za");
    

    And skip the part where you setting the path via the property.

    EDIT: NOTICE It also seems like you have missed a “d” on the dc=za.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the problem: I have a WCF service and a few sites connecting
Good morning / afternoon, I have a problem with LDAP connector, when I use
I have a problem with connecting to remote graph from DirectShow Filter Graph Editor.
Hello! I have problem with connecting to remote host. I forgot ssh password but
I have problem with connecting to Sql Server from my local machine. Seems like
I have a problem connecting to any serial port (want to exchange with an
Ok, I have a really stupid problem here, and I'm starting to get really
I have problem with connecting to a Firebird database. It works perfectly, when I
I have problem while connecting to mysql database using ADO.NET Driver for MySQL (Connector/NET)
I have a problem connecting to Informix server(windows) using ADO.NET. I'm using Listing 1

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.