using (var svc = new AdministrationService.AdministrationClient())
{
var request = new AdministrationService.ManagementGroupRequestOfCreateSecurityAccountForExistingEntity();
request.Token = "Token";
request.ManagementGroup = "Management group";
var createSecurityAccountForExistingEntity = new AdministrationService.CreateSecurityAccountForExistingEntity();
createSecurityAccountForExistingEntity.AccountName = "Account name";
createSecurityAccountForExistingEntity.AccountOwner_RSN = new Guid("80061735-5a34-483f-9759-d3442ba2f585");;
createSecurityAccountForExistingEntity.EmailAddress = "john.doe@simplicitycrm.com";
createSecurityAccountForExistingEntity.ResetPasswordEmailTemplateID = "RESET_PASSWORD_REQUEST";
var managementGroup = new AdministrationService.SecurityAccountManagementGroup();
managementGroup.GroupCode = "LOYALTY_MEMBER";
managementGroup.CanApproveTransactions = false;
createSecurityAccountForExistingEntity.ManagementGroups = new AdministrationService.SecurityAccountManagementGroup[] { managementGroup };
request.Value = createSecurityAccountForExistingEntity;
AdministrationService.Result result = svc.CreateSecurityAccountForExistingEntity(request);
if (result.FaultCode == 0)
{
}
else
{
throw new Exception(result.FaultDescription);
}
}