Nick Prozee
Nick Prozee

Reputation: 2913

C# LDAP against LDS


I'm trying to resolve this problem but I cannot get this to work.
The Question

What is wrong with my query?

The Code

private static void ExecuteQuery()
        {
            string sDomain = "10.12.14.165:389";
            string sDefaultOU = "CN=GeneralUsers,CN=Company,DC=Server,DC=LDS,DC=LOCAL";
            string sServiceUser = "myUser";
            string sServicePassword = "myPassword";


            DirectoryEntry ldapEntry = new DirectoryEntry("LDAP://" + sDomain + @"/" + sDefaultOU,
                                                          sServiceUser,
                                                          sServicePassword);

            DirectorySearcher ldapSearcher = new DirectorySearcher(ldapEntry);
            //Error Occurs here
            SearchResultCollection ldapResult = ldapSearcher.FindAll();
        }

The Error

@ SearchResultCollection ldapResult = ldapSearcher.FindAll();
Exception: There is no such object on the server.

Attention

The Object DOES Exist

Upvotes: 0

Views: 1220

Answers (1)

Nick Prozee
Nick Prozee

Reputation: 2913

The problem occured in the LDS Configuration. the user I was authenticating with had no rights to the LDS, the query I was using was working fine.

Upvotes: 0

Related Questions