Last post Jun 27, 2012 01:07 PM by simflex
Jun 27, 2012 11:13 AM|simflex|LINK
I am grateful for the wonderful help I got to make this code work.
Right now, I am having some additional issues.
When the dropdownlist box is populated with list from Active Directory, some unwanted/un-needed names appear on the dropdownlist.
These names are not even employee names.
Is there a way to NOT allow those list to be included in the dropdownlist?
Specifically, is it possible to filter the list by hardcoding the names you either want to appear or keep out the names you don't want to appear?
Thanks a lot in advance.
Private Sub FillDropdown()
Dim oroot As DirectoryEntry = New DirectoryEntry("LDAP://OU=Departments,DC=domain,DC=com")
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=person))" ' search filter
osearcher.PropertiesToLoad.Add("name") ' full name
oresult = osearcher.FindAll()
For Each result In oresult
If Not result.GetDirectoryEntry.Properties("name").Value Is Nothing Then
emplist.DataSource = list
OK, I think I found something that could solve my problem. I just need help implementing.
I found that I could use proxyAddress (email addresses) to list the names that would populate the dropdownlist.
I just need help writing out the email addresses.
I was able to make one work but when I add additional email addresses, it no longer works.
Please see example:
I would like to add up to 6 email addresses to the list using this proxyAddresses code.
Thanks a lot
Jun 27, 2012 01:07 PM|simflex|LINK
Ok, I got these issues worked out; thanks to the Google dude!
Just keeping adding (...)