Guest User

Untitled

a guest
Jun 16th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. domainAndUsername = domain + @"" + username;
  2. entry = new DirectoryEntry(_path, domainAndUsername, pwd);
  3. entry.AuthenticationType = FindAuthTypeMicrosoft(authType);
  4.  
  5. DirectoryEntry entry = new DirectoryEntry("LDAP://server-name/DC=domainContext,DC=com");
  6. entry.Username = @"DOMAINaccount";
  7. entry.Password = "...";
  8. DirectorySearcher searcher = new DirectorySearcher(entry);
  9. searcher.Filter = "(&(objectClass=user)(sn=Jones))";
  10. SearchResultCollection results = searcher.FindAll();
Add Comment
Please, Sign In to add comment