Private Sub FillDropdown()
Dim oroot As DirectoryEntry = New DirectoryEntry("LDAP://OU=Groups Application,OU=Unified Data Centers,DC=one,DC=ads,DC=che,DC=org")
Dim osearcher As DirectorySearcher = New DirectorySearcher(oroot)
Dim oresult As SearchResultCollection
Dim result As SearchResult
Dim list As New List(Of String)
osearcher.Filter = "(&(objectCategory=user)(memberOf=OU=Groups Application,OU=Unified Data Centers,DC=one,DC=ads,DC=che,DC=org))"
' search filter; only display emp with firstname / lastname pair
osearcher.PropertiesToLoad.Add("name") ' member
oresult = osearcher.FindAll()
For Each result In oresult
If Not result.GetDirectoryEntry.Properties("name").Value Is Nothing Then
List.Add(result.GetDirectoryEntry.Properties("name").Value.ToString())
Call List.Sort()
End If
Next
' LVGlobal.subitems.add
ListBox1.Items.Add(list)
End Sub
Private Sub FillDropdown()
Dim oroot As DirectoryEntry = New DirectoryEntry("LDAP://OU=Groups Application,OU=Unified Data Centers,DC=one,DC=ads,DC=che,DC=org")
Dim osearcher As DirectorySearcher = New DirectorySearcher(oroot)
Dim oresult As SearchResultCollection
Dim result As SearchResult
Dim list As New List(Of String)
osearcher.Filter = "(objectCategory=group)"
' search filter; only display emp with firstname / lastname pair
osearcher.PropertiesToLoad.Add("memberof") ' member
oresult = osearcher.FindAll()
For Each result In oresult
If Not result.GetDirectoryEntry.Properties("group").Value Is Nothing Then
list.Add(result.GetDirectoryEntry.Properties("member").Value.ToString())
Call list.Sort()
End If
Next
' LVGlobal.subitems.add
ListBox1.Items.Add(list)
End Sub
i GET THIS MESSAGE WHENTRYING TO GRABS ALL AD gROUPS INTHIS OU