Guest User

Untitled

a guest
Mar 12th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. adobject = myLdapConnection.Children.Add(value, type);
  2.  
  3. //string username = "CN=testuser,CN=Users,DC=ad,DC=domain,DC=com";
  4. //string username = "testuser";
  5. //string username = "AD\testuser";
  6.  
  7. //string server="LDAP://10.10.10.10:389";
  8. //string server="LDAP://10.10.10.10";
  9.  
  10. string server = "LDAP://10.67.146.254:389";
  11. string basedn = "ou=testou,DC=ad,DC=domain,DC=com";
  12. string username = "CN=testuser,CN=Users,DC=ad,DC=domain,DC=com";
  13. string password="plaintextpassword";
  14. DirectoryEntry ldapConnection = new DirectoryEntry(server+"/"+basedn,username,password,AuthenticationTypes.Secure);
  15. string value="ou=testsubou,ou=testou,DC=ad,DC=domain,DC=com";
  16. string type="organizationalUnit";
  17. DirectoryEntry adobject = myLdapConnection.Children.Add(
  18. value, type);
  19. adobject.CommitChanges();
Add Comment
Please, Sign In to add comment