Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- adobject = myLdapConnection.Children.Add(value, type);
- //string username = "CN=testuser,CN=Users,DC=ad,DC=domain,DC=com";
- //string username = "testuser";
- //string username = "AD\testuser";
- //string server="LDAP://10.10.10.10:389";
- //string server="LDAP://10.10.10.10";
- string server = "LDAP://10.67.146.254:389";
- string basedn = "ou=testou,DC=ad,DC=domain,DC=com";
- string username = "CN=testuser,CN=Users,DC=ad,DC=domain,DC=com";
- string password="plaintextpassword";
- DirectoryEntry ldapConnection = new DirectoryEntry(server+"/"+basedn,username,password,AuthenticationTypes.Secure);
- string value="ou=testsubou,ou=testou,DC=ad,DC=domain,DC=com";
- string type="organizationalUnit";
- DirectoryEntry adobject = myLdapConnection.Children.Add(
- value, type);
- adobject.CommitChanges();
Add Comment
Please, Sign In to add comment