Solved

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

Posted on 2010-11-30
3
337 Views
Last Modified: 2012-05-10
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.

Thanks!!
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()
            colUsers.Add(result.Properties("cn")(0))
        Next result
        colUsers.Sort()
        DropDownList1.DataSource = colUsers
        DropDownList1.DataBind()
        de.Dispose()
    End Sub

Open in new window

0
Comment
Question by:JB4375
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 34242907
0
 
LVL 1

Author Closing Comment

by:JB4375
ID: 34282143
Thanks CC!!
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34282151
Glad to help :-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question