Guest User

Untitled

a guest
Aug 8th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. logon to specific OU using Directoryservices
  2. Path: LDAP://my.domain User: DOMAINuser Pass: mypass
  3. DOMAINuser = Autenticated
  4.  
  5. Path: LDAP://my.domain, ou=myou, dc=my, dc=domain User: user Pass: mypass
  6.  
  7. Path: LDAP://my.domain/ou=myou User: user Pass: mypass
  8.  
  9. Path: LDAP://my.domain/ou=myou User: DOMAINuser Pass: mypass
  10.  
  11. LDAP://servername/ou=MyOU,dc=my,dc=domain
  12.  
  13. LDAP://ou=MyOU,dc=my,dc=domain (for server-less binding)
  14.  
  15. string adPath = "LDAP://ou=myou,dc=my,dc=domain";
  16. string adUser = "myuser";
  17. string adPass = "mypass";
  18.  
  19. // you might need to play around with the "AuthenticationTypes" to get it to work
  20. DirectoryEntry entry = new DirectoryEntry(adPath, adUser, adPass, AuthenticationTypes.None);
  21.  
  22. DirectorySearcher searcher = new DirectorySearcher(entry);
  23.  
  24. searcher.Filter = @"(objectClass=Person)";
  25.  
  26. string adPath = "LDAP://my.domain/ou=myou,dc=my,dc=domain";
  27.  
  28. string adPath = "LDAP://dc01.my.domain/ou=myou,dc=my,dc=domain";
Add Comment
Please, Sign In to add comment