Delete/Remove users from role RRS feed

  • Question

  • User238037111 posted


    I am using follorwing code to delete user

    DirectoryEntry user = new DirectoryEntry("LDAP://cn=someuser,ou=users,dc=somedomain,dc=com"); DirectoryEntry ou = user.Parent; ou.Children.Remove(user); ou.CommitChanges();

    Before using above code, I would like to chekc that is User is member of "Users" role or not, if user is member of Role then first remove users from "Users" role then delete the users. I am not sure how do I check userr existing and delete from role.

    Please suggest

    Friday, July 24, 2009 1:03 PM

All replies

  • User2098908334 posted

    Please go through this msdn article.



    Saturday, July 25, 2009 3:58 AM