JB4375
asked on
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.
Thanks!!
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to help :-)
ASKER