November 5th, 2009, 10:56 PM
List all the Subnets within a SITE in a directory service
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
ULONG errorCode = LDAP_SUCCESS;
PWCHAR pMyFilter = L"(&(objectCategory=site))";
WCHAR **pMyAttributes = new WCHAR*;
pMyAttributes = L"cn";
pMyAttributes = L"company";
pMyAttributes = L"department";
pMyAttributes = L"telephoneNumber";
pMyAttributes = L"memberOf";
pMyAttributes = NULL;
errorCode = ldap_search_s(
pMyFilter, // Filter
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.