02-11-2012 11:29 PM
Hello- I'm creating users in BWS, but adding Account details causes the below error:
23:23:33,146 INFO [stdout] (http--0.0.0.0-8080-1) Error occured: ONE_OR_MORE_FAILURES
23:23:33,147 INFO [stdout] (http--0.0.0.0-8080-1) Individual responses - Code: USER_CREATION_FAILED Message: Failed to create user: Internal error
The code I'm using is below. The code works if I remove the line "newUser.setAccountAttributes(accountAttributes);" but then the user isn't created right in BES (no email).
CreateUsersRequest createUsersRequest = new CreateUsersRequest(); createUsersRequest.setMetadata(connect.get_meta()); NewUser newUser=new NewUser(); UserAttributes userAttributes=new UserAttributes(); //enable user to logon with BAS authenticator userAttributes.setAuthenticator(connect.getAdAuthe nticator());//Active Directory userAttributes.setLoginName(userId); userAttributes.setLoginPassword("l@bP@ssw0rd"); userAttributes.setDisplayName(userId); userAttributes.setRoleUid(connect.getDefaultRole() .getUid()); userAttributes.setDomain(adDomain); newUser.setUserAttributes(userAttributes); //use this mail account AccountAttributes accountAttributes=new AccountAttributes(); accountAttributes.setEmailAddress(userId+"@"+mailD omain); newUser.setAccountAttributes(accountAttributes); // select a BlackBerry Enterprise Server to create the user on newUser.setServer(connect.getServer()); createUsersRequest.getNewUsers().add(newUser); CreateUsersResponse createUsersResponse = connect.get_bws().createUsers(createUsersRequest); if (createUsersResponse.getReturnStatus().getCode().c ompareTo("SUCCESS")!=0) { System.out.println("Error occured: " + createUsersResponse.getReturnStatus().getCode()); }
Any help is appreciated.
Sean
02-13-2012 11:46 AM
Can you create this user from the BAS console with the same information?
Does the user need access to the BAS?
Could you provide some sample information which you are using to populate the below request? userId is usually used to reference the numerical ID of the user in the BAS.
02-17-2012 05:32 AM
Same issue here... Can't create users with an accountattributes set. Any resolution?
02-17-2012 08:30 AM
Please respond with the information requested in my previous post.
02-17-2012 12:09 PM
I have admin@mushroom.com exchange mailbox set up (Exchange/BES installed side-by-side on the same machine) and I'm trying to create BES user for it.
1. Yes, I can successfully create this user from the administration console.
2. Hm, I guess not... yet. Does it matter?
3. Here's the sample code:
var userAttributes = new UserAttributes
{
authenticator = ADAuthenticator,
loginName = "admin@mushroom.com",
loginPassword = "P@ssw0rd"
domain = "ad.domain.name",
displayName = "admin@mushroom.com",
roleUid = defaultRole.uid
};
var accountAttributes = new AccountAttributes();
accountAttributes.emailAddress = "admin@mushroom.com";
var server = GetServer();
var newUser = new NewUser
{
userAttributes = userAttributes,
accountAttributes = accountAttributes,
server = server
};
var createUsersRequest = new CreateUsersRequest
{
metadata = _metadata,
newUsers = new[] { newUser }
};
var response = BwsService.createUsers(createUsersRequest);
02-17-2012 01:01 PM
02-17-2012 01:40 PM
02-17-2012 01:46 PM
Could be an issue with the domain used, can you confirm it's correct and works when trying to login to the BAS console?