Hi,
I am using LDAPMBS against Active Directory and it works fine.
There are some examples I use:
dim l as new LDAPMBS("ad.domain.fi", 389)
if l.Lasterror <> 0 then
MsgBox "LDAP Error "+str(l.Lasterror)
return
end if
// Authentication with testuser
l.Bind "testuser@domain.fi", "password", l.kAuthSimple
if l.Lasterror <> 0 then
MsgBox "Bind Error "+str(l.Lasterror)
return
end if
// Info about "testuser"
dim about() As Dictionary = l.Search("OU=company,DC=domain,DC=fi", l.kScopeSubtree, "(samAccountName=testuser)", array("distinguishedName", "cn", "displayName", "mail"))
if l.Lasterror <> 0 then
MsgBox "UserInfo Error "+str(l.Lasterror)
return
end if
// list of members in "somegroup"
dim results() as Dictionary = l.Search("CN=somegroup,OU=Groups,OU=company,DC=domain,DC=fi", l.kScopeSubtree, "(objectclass=*)", array("member"))
if l.Lasterror <> 0 then
MsgBox "Search Error "+str(l.Lasterror)
return
end if
I’m trying to check if testuser is member of somegroup. There is enough information to check it now looping thru members list.
There is still problem with nested group because this seartch just list nested groups (not users inside nested groups) with users.
But I’m thinking there must be some way to check with ldap if testuser is memberOf somegroup. And this would solve the problem with nested groups also.
So if there is someone who knows AD and winldap, please share Your wisdom
Jukka