3
I am trying to add a user to the group, but I am returned the following error:
Message: The server is reluctant to process the request.
Errorcode: -2147016651
Extendederror: 1359
Extendederrormessage: 0000054F: Svcerr: DSID-031A120C, problem 5003 (WILL_NOT_PERFORM), date 0
Hresult: -2147016651
I get this with the following code:
public void UpdateUserGroup(ADEntry selectedEntry, ADEntry groupEntry, bool addUser)
{
DirectoryEntry selectedDirEntry = selectedEntry.ToDirectoryEntry(this.Connector.Credential);
DirectoryEntry groupDirEntry = groupEntry.ToDirectoryEntry(this.Connector.Credential);
if ((selectedDirEntry.SchemaClassName.Equals("user")) && (groupDirEntry.SchemaClassName.Equals("group")))
{
if (addUser)
{
groupDirEntry.Properties["member"].Add(selectedDirEntry.Path);
}
else
{
groupDirEntry.Properties["member"].Remove(selectedDirEntry.Path);
}
groupDirEntry.CommitChanges();
groupDirEntry.RefreshCache();
}
}
The user I am using is Domainadmin. Does anyone have any suggested solution?
Grateful.
Which version of the Framework you are using?
– Luiz Angelo
I’m using version 4.5
– lvendrame
Are you just changing the groups or do you have any other changes being made? Specifically, password change?
– Luiz Angelo