Tech Support > Operating Systems > Windows 2003 > Cannot perform searching in Active Directory in .net
Cannot perform searching in Active Directory in .net
Posted by tl on February 10th, 2004


Hello everyone,

I wrote the .NET program that can search some domain account information in
active directory.
In the local network, I use client machines (windows XP and 2000) to run the
program and it worked fine.
However, I run this program in some servers that are also
in the local network, it fails.

It says "The specified domain either does not exist or could not be
contacted."

Then, I tried the program in the active directory machine. (query
locally).However, it also runs fail.

There are several servers and a number of client machines in my local
network.

Would anyone mind helping me ?

Thank you.


Posted by Joe Kaplan \(MVP - ADSI\) on February 10th, 2004


This question is probably better answered in microsoft.public.adsi.general,
but I can help here too.

Normally when I hear about these kinds of errors, it is because you are
using ADSI features like serverless binding or binding with default
credentials that rely on the underlying security context to pick a domain
controller and supply credentials. Then, if the application runs under a
different security context, those assumptions may no longer be true and the
application fails.

You can usually tell if this is the problem by supplying a server name and
credentials in all of your DirectoryEntry constructors. If that fixes the
problem, then the that is the issue. From there you have to decide how you
want to deal with the situation. Basically, you can either ensure that the
assumptions you are making are true or you can supply server names and
credentials, but there are many ways to go about approaching either of those
solutions.

Please post your code if you need more details.

Joe K.

"tl" <xxx@xxx.xxx> wrote in message
news:%23bSl8y47DHA.712@tk2msftngp13.phx.gbl...