Query Domain API ?

  • Thread starter Thread starter xenophon
  • Start date Start date
X

xenophon

I have C# 1.1 code that queries a domain controller for groups and etc
with LDAP queries. The works fine until the DC is down for any reason.
There are many DCs in the domain (win 2003 native). I would like to
relpace my single-computer query code. I would like to do something
that queries "the domain" instead of "the domain controller".

Is there an API call that will help me here?

Thanks.
 
xenophon said:
I have C# 1.1 code that queries a domain controller for groups and etc
with LDAP queries. The works fine until the DC is down for any reason.
There are many DCs in the domain (win 2003 native). I would like to
relpace my single-computer query code. I would like to do something
that queries "the domain" instead of "the domain controller".

Is there an API call that will help me here?

Thanks.

That means that you are binding against a DC (using the server name), you
should bind against the root of the domain (RootDSE).

Willy.
 
Hi,

Welcome to MSDN newsgroup!

Let me explain my understanding for your issue: you want the LDAP query
runs well when one DC has been down in the current domain environment. If I
have misunderstood anything, please let me know.

In this scenario, I think remove "dc=" in your LDAP clause is a good way
because the client will bind to the DC automatically with it.

I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.

Yuan Ren [MSFT]
Microsoft Online Support
 
"Yuan Ren[MSFT]" said:
Hi,

Welcome to MSDN newsgroup!

Let me explain my understanding for your issue: you want the LDAP query
runs well when one DC has been down in the current domain environment. If
I
have misunderstood anything, please let me know.

In this scenario, I think remove "dc=" in your LDAP clause is a good way
because the client will bind to the DC automatically with it.

I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.

Yuan Ren [MSFT]
Microsoft Online Support

Yuan,

Doing so will bind to the current logon server(DC), so if this DC goes down
after the logon the same thing will happen.
IMO the only way to solve this issue is to bind to the root (using RootDSE),
if you really need to, you can get a list of available DC's from the root
and try to use a server bind against one of them.

Willy.
 
Yuan, you have misunderstood me completely. I did not want to query a
single domain controller with "dc=", because I am already doing that.
I wanted to query *any* domain controller. It appears that I need to
use the "rootdse" space.

Thanks.
 
Hi,

Sorry for misunderstanding!

Willy's suggestion seems wonderful! RootDSE is suitable for this scenario.
Actually, I'm glad to hear your problem has been resolved! If you have any
issues or concerns in the future, please let me know. I will be happy to be
of further assistance.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 
Back
Top