我知道 SAMAccountName,现在想用反映此用户在整个目录中的组成员身份的条目来填充组列表。这是我的开始,但我很难过:
Dim path As String = WebConfigurationManager.AppSettings("ldapPath")
Dim entry As New DirectoryEntry(path)
Dim search As DirectorySearcher = New DirectorySearcher(entry)
Dim groupList As StringBuilder = New StringBuilder()
search.Filter = "(SAMAccountName=" & _thisUser.UserName & ")"
search.PropertiesToLoad.Add("memberOf")
'search.SearchScope = SearchScope.Subtree
For Each res As SearchResult In search.FindAll
Next ''Just doing this so I can look at "res" objects in debug
我不知道如何遍历这个。请问,有什么指点吗?