Free for PREMIUM members
Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!
Public Function GetAllADGroups() As List(Of String)
Dim myDirectory As DirectoryEntry = GetDirectoryEntry()
Dim mySearcher As New DirectorySearcher(myDirectory)
Dim mySearchResultColl As SearchResultCollection
Dim mySearchResult As SearchResult
Dim result As New List(Of String)
Dim objGroupEntry As DirectoryEntry
' Build LDAP query
mySearcher.Filter = "(&(objectClass=group))"
mySearchResultColl = mySearcher.FindAll()
If (mySearchResultColl.Count <> 0) Then
For Each mySearchResult In mySearchResultColl
objGroupEntry = mySearchResult.GetDirectoryEntry()
' return value
Catch ex As System.Exception
Open in new window
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $95.20.
Premium members get this course for $159.20.
Premium members get this course for $62.50.
Premium members get this course for $37.50.
Premium members get this course for $389.00.
Premium members get this course for $349.00.
Premium members get this course for $168.80.