Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. using (DirectoryEntry entry = new DirectoryEntry("LDAP://XX.XX.XX.Xx")) //line of erorr!! :( !!
  2. using (DirectorySearcher search = new DirectorySearcher())
  3. {
  4. var accountDN = string.Format("CN=Users,DC=aduam,DC=com", userName);
  5. entry.AuthenticationType = AuthenticationTypes.None;
  6. entry.Path = StrPath;
  7. entry.Username = accountDN;
  8. entry.Password = password;
  9. search.SearchRoot = entry;
  10. search.FindOne();
  11.  
  12. entry.Close();
  13. entry.Dispose();
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement