Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string addUserToGroup(string userDN, string groupDN)
- {
- try
- {
- DirectoryEntry de = new DirectoryEntry("LDAP://localhost:389/" + groupDN);
- de.Username = "myUsername";
- de.Password = "myPassword";
- de.Properties["member"].Add(userDN);
- de.CommitChanges();
- de.Close();
- //return true;
- return "yes";
- }
- CN=sandbox,CN=testApp1,DC=ITOrg
- CN=sandbox,CN=testApp2,DC=ITOrg .. etc
- CN=1@test.com,CN=People,CN=sandbox,DC=ITOrg
- CN=Readers,CN=Roles,CN=sandbox,CN=testApp1,DC=ITOrg
Add Comment
Please, Sign In to add comment