I am trying to add an Active Directory user to a group, and get "The server is unwilling to process the request." on CommitChanges(). I know I am binding to the directory OK and am finding both the groupDN path and userDN path, as I can return the GUID for each. Here is my code - if anyone can help me that would be fantastic! I have been hitting a brick wall over the last day trying to resolve this. Items enclosed in {} are where I replace an actual value with a generic one for posting here (i.e {domain} instead of posting our domain name).

string groupDn = "LDAP://CN={group name},OU=ApplicationGroups,DC={domain},DC={domain_dot_ext},DC={domain_dot_ext},";
 string userDn = @"LDAP://CN={lastname}\, {firstname},CN=Users,dc=scs,dc=sk,dc=ca";

dirEntry = new DirectoryEntry(groupDn, null, null, AuthenticationTypes.Secure);

I have even gone so far as to pass my security credentials (I'm in Domain Admins) to make sure it's not a security credentials issue.

I'm missing something - but am at a loss. Hope someone out there can help.


I was having this same issue with the exact same block of code.

I replace your lines 5 and 6 with the following code and it worked perfectly.

dirEntry.Invoke("Add", New Object() {userDN})