Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • Last Modified:

Populate a Drop Down List with Group Members Exception.......

I've done this in the past, and even got help with it here.  The difference, in this case, is that before the group name within the LDAP path was designated as OU=GroupName. The group I'm working with now is CN=GroupName.

It would follow that I could just change the existing code to CN=GroupName and that would fix it but the drop down list isn't populating. I'm hoping it's something trivial that I missed.

Public Sub FillDropdown()
        Dim ldapPath As String = "LDAP://CN=GroupName,DC=Departments,DC=ad,DC=domain,DC=com"
        Dim de As New DirectoryEntry(ldapPath)
        Dim ds As New DirectorySearcher(de)
        ds.PageSize = 1000
        ds.Filter = "(objectCategory=User)"

        Dim colUsers As ArrayList
        colUsers = New ArrayList
        Dim result As SearchResult

        For Each result In ds.FindAll()
        Next result
        DropDownList1.DataSource = colUsers
    End Sub

Open in new window

  • 2
1 Solution
JB4375Author Commented:
Thanks CC!!
Glad to help :-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now