I'm trying to get the groups a user is member of from an Open Ldap using vb.net 3.5.
Although so far I have managed to connect to the ldap server and get the user's info like sn, givenname, description, mail, adspath,
I have absolutely no information about the user's groups.
My code is like this:
Dim oEntry as New DirectoryEntry
Dim oSearcher as New DirectorySearcher
oEntry = New DirectoryEntry("LDAP://myServer/ou=test, dc=example, dc=com", username, pwd, AuthenticationTypes.ServerBind)
oSearcher = New DirectorySearcher(oEntry, "(uid=" & uName & ")")
oResult = oSearcher.FindOne()
if not oResult is Nothing then
Dim ADUser as DirectoryEntry
ADUSer = oResult.GetDirectoryEntry()
Well, ADUser has no info on user membership whatsoever.
Am I doing something wrong? Should I use System.DirectoryServices.Protocols as I saw someone mentioning instead
of System.DirectoryServices or is .Protocols just for Framework 2.0?
View Complete Post