On Monday 05 January 2009 19:56:03 omkar wrote:
> hi all,
> I am trying to write one tool, that could find the all available dc
> values.

You should pose your problem more precisely. E.g., maybe you would prefer to 
find the DC values for all entries of objectclass domain?

> see example:
> -> base dn: dc=A, dc=B, dc=C
>                   ou =users, dc=A, dc=B, dc=C
>                   ou= groups,dc=A, dc=B, dc=C
>                   dc=D, dc=A, dc=B, dc=C
>                             ou=users, dc=D, dc=A, dc=B, dc=C
> something like structure I have in LDAP DIR,
> now I just want to find out all avalable dc's by accepting base dn as
> input in PERL:LDAP.

Relying on the DN to be composed of the value you want is not necessarily the 
best LDAP practice.

Why don't you search your base DN with a filter of (objectclass=domain) and 
request the DC attribute. It will accomplish the same thing, but in a much 
more robust way.


Regards,
Buchan

Reply via email to