Hi LDAP gurus,

We have a requirement to query a directory service (it can be any Microsoft ADS, IBM tivoli, Open Directory, Apache Directory etc) and extract all the SITES belonging to the DS.

And when user selects a SITE we should show all the subnets belonging to the SITE.

I have used the functions in the 'wldalp32.dll' and got all the SITES under the DS.

The following code got all the SITES
PWCHAR="CN=Sites,CN=Configuration,DC=myDomain,DC=com"
ULONG errorCode = LDAP_SUCCESS;
LDAPMessage* pSearchResult;
PWCHAR pMyFilter = L"(&(objectCategory=site))";
WCHAR **pMyAttributes = new WCHAR*[6];

pMyAttributes[0] = L"cn";
pMyAttributes[1] = L"company";
pMyAttributes[2] = L"department";
pMyAttributes[3] = L"telephoneNumber";
pMyAttributes[4] = L"memberOf";
pMyAttributes[5] = NULL;

errorCode = ldap_search_s(
pLdapConnection,
pMyDN,
pMyFilter, // Filter
pMyAttributes,
0,
&pSearchResult);

I have a couple of questions
a) SITES - Is this an Ms Active Directory concept. Do non AD directory services have SITES?

b) If some directory services does not have SITES configured, am sure the above code would return an error. In that case we just will get all the subnets listed in the directory service. Is this approach good enuf to ensure that we support all directory services?

Any answers would be appreciated.