B
Brian Henry
I'm trying to get all the user names of users out of an active directory so
they can be put into a database, but when i run the code below it gives
nothing back, if i change username to just name it gives me the full name of
the user, but not the user name... what is going wrong? thanks
Dim entry As New DirectoryEntry("LDAP://reschini")
Dim mySearcher As New DirectorySearcher(entry)
mySearcher.Filter = "(objectClass=user)"
Dim resEnt As SearchResult
For Each resEnt In mySearcher.FindAll
Try
Me.ListBox1.Items.Add(resEnt.GetDirectoryEntry.Username)
Catch ex As Exception
End Try
Next
they can be put into a database, but when i run the code below it gives
nothing back, if i change username to just name it gives me the full name of
the user, but not the user name... what is going wrong? thanks
Dim entry As New DirectoryEntry("LDAP://reschini")
Dim mySearcher As New DirectorySearcher(entry)
mySearcher.Filter = "(objectClass=user)"
Dim resEnt As SearchResult
For Each resEnt In mySearcher.FindAll
Try
Me.ListBox1.Items.Add(resEnt.GetDirectoryEntry.Username)
Catch ex As Exception
End Try
Next