using (var svc = new AdministrationService.AdministrationClient())
{
var request = new AdministrationService.ManagementGroupRequestOfCreateSecurityAccountForNewUser();
request.Token = "Token";
request.ManagementGroup = "Management group";
var createSecurityAccountForNewUser = new AdministrationService.CreateSecurityAccountForNewUser();
createSecurityAccountForNewUser.AccountName = "Account name";
createSecurityAccountForNewUser.EmailAddress = "john.doe@simplicitycrm.com";
createSecurityAccountForNewUser.Title = "Mr";
createSecurityAccountForNewUser.FamilyName = "Doe";
createSecurityAccountForNewUser.GivenName = "John";
createSecurityAccountForNewUser.ResetPasswordEmailTemplateID = "RESET_PASSWORD_REQUEST";
var managementGroup = new AdministrationService.SecurityAccountManagementGroup();
managementGroup.GroupCode = "LOYALTY_MEMBER";
managementGroup.CanApproveTransactions = false;
createSecurityAccountForNewUser.ManagementGroups = new AdministrationService.SecurityAccountManagementGroup[] { managementGroup };
request.Value = createSecurityAccountForNewUser;
AdministrationService.Result result = svc.CreateSecurityAccountForNewUser(request);
if (result.FaultCode == 0)
{
}
else
{
throw new Exception(result.FaultDescription);
}
}