I\'m trying to figure out how to search AD from C# similarly to how \"Find Users, Contacts, and Groups\" works in the Active Directory Users and Computers tool. I have a str
To add onto Miyagi's answer....
Here's a filter/query to apply to DirectorySearcher
DirectorySearcher ds = new DirectorySearcher(); ds.Filter = "samaccountname=" + userName; SearchResult result = ds.FindOne();