我知道SAMAccountName,現在想要填充反映此用戶組成員資格的整個目錄的組列表。這是我的開始,但我很難過:在VB.NET中查詢LDAP。我有用戶帳戶,並且我想要一個用戶組的列表
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
我不知道如何遍歷這個。請問,任何指針?
看起來它會做的伎倆。我會用我的發現回覆你。非常感謝。 – YogaMatt
Hoorah!我不得不VB-ize它,但是是多麼神奇的指針,比你非常多。 – YogaMatt