ConfigurationItem removeUserInvokeInfo = configClient.InvokeMethod(configClient.GetItem(milestoneUser.RolePath + "/" + ItemTypes.UserFolder), "RemoveRoleMember");
The code returns a object with 1 property: “ItemSelection”. I’ve tried filling this one with a SID but that doesn’t work. I’ve also tried this but still get the error:
ConfigurationItem removeUserInvokeInfo = configClient.InvokeMethod(configClient.GetItem(milestoneUser.RolePath + "/" + ItemTypes.UserFolder), "RemoveRoleMember");
removeUserInvokeInfo.Properties = new Property[2];
removeUserInvokeInfo.Properties[0] = new Property("ItemSelection", "");
removeUserInvokeInfo.Properties[1] = new Property("memberSid", identity);
ConfigurationItem invokeResultItem = configClient.InvokeMethod(removeUserInvokeInfo, "RemoveRoleMember");
There’s almost no documentation to read about this.