Guest User

Untitled

a guest
Jun 8th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public string addUserToGroup(string userDN, string groupDN)
  2. {
  3. try
  4. {
  5. DirectoryEntry de = new DirectoryEntry("LDAP://localhost:389/" + groupDN);
  6. de.Username = "myUsername";
  7. de.Password = "myPassword";
  8. de.Properties["member"].Add(userDN);
  9. de.CommitChanges();
  10. de.Close();
  11. //return true;
  12. return "yes";
  13. }
  14.  
  15. CN=sandbox,CN=testApp1,DC=ITOrg
  16. CN=sandbox,CN=testApp2,DC=ITOrg .. etc
  17.  
  18. CN=1@test.com,CN=People,CN=sandbox,DC=ITOrg
  19.  
  20. CN=Readers,CN=Roles,CN=sandbox,CN=testApp1,DC=ITOrg
Add Comment
Please, Sign In to add comment