Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 'Clears listbox results.Items.Clear() 'Connect to AD Database Dim rootEntry As New DirectoryEntry("GC://DC=TonyNet,DC=org", Domain.Text + userID.Text, password.Text) 'Set What you want to search for Dim searcher As New DirectorySearcher(rootEntry) searcher.PropertiesToLoad.Add("cn") searcher.PropertiesToLoad.Add("mail") 'Set Your Search Filter searcher.Filter = "(objectCategory=Computer)" 'Finds all Dim queryResults As SearchResultCollection queryResults = searcher.FindAll() 'Puts the results into a list Box Dim result As SearchResult For Each result In queryResults results.Items.Add(result.Properties("cn")(0)) Next End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.