Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Web Services

Reply
New Developer
Posts: 7
Registered: ‎01-21-2010
My Device: Pearl

findMailStoreUsers cant find new users

Hi,

 

When i create a new user in Exchange, and then go to find that user via findMailStoreUsers, they are not being returned.  However, if i wait 24 hours, it is finding them.

From what i understand the BES system does not do normal AD lookups but does some kind of cache?

Is there any way to force BES to find a user that was created just seconds before?

here is my code:

 

            BESWebService.MailStoreUserSearchCriteria criteria = new BESWebService.MailStoreUserSearchCriteria();
            criteria.displayName = emailAddress;
            criteria.isNewUserOnly = true;
            criteria.isNewUserOnlySpecified = true;
            BESWebService.MailStoreUserSearchResultSortByEnum sortByEnum = new BESWebService.MailStoreUserSearchResultSortByEnum();
            sortByEnum.@enum = BESWebService.MailStoreUserSearchResultSortByEnumType.EMAIL_ADDRESS;
            sortByEnum.enumSpecified = true;
            int pageSize = 1;
            BESWebService.findMailStoreUsers findMailStoreUsersRequest = new BESWebService.findMailStoreUsers();
            findMailStoreUsersRequest.searchCriteria = criteria;
            findMailStoreUsersRequest.sortByCriteria = sortByEnum;
            findMailStoreUsersRequest.sortByAscendingOrder = true;
            findMailStoreUsersRequest.criteriaAndResultSetLocale = locale;
            findMailStoreUsersRequest.pageCriteria = null;
            findMailStoreUsersRequest.pageSize = pageSize;
            BESWebService.findMailStoreUsersResponse findMailStoreUsersResponse = emailExchangeWebService.findMailStoreUsers(findMailStoreUsersRequest);

 

Thanks,

Eric

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: findMailStoreUsers cant find new users

[ Edited ]

Hi Eric,

 

You can force the BES to perform a refresh of the users indexed from the BAS console ("Create a user" >  "Search" > "Refresh available user list from company directory") however there is currently no API available to do this from the BAA.

Garett
@garettBeuk
--
Goodbye everybody!
New Developer
Posts: 7
Registered: ‎01-21-2010
My Device: Pearl

Re: findMailStoreUsers cant find new users

So how in the world do Hosters create add users dynamically?

Your telling me something that works in 4.0, and its the most basic thing in the WORLD doesnt work in 5.0?  How do you design an API that is requires a 24 hour waiting period?

 

There MUST be a way to add users without waiting the 24 hours.

 

Eric

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: findMailStoreUsers cant find new users

Hi Eric,

 

The BAA was just introduced in 5.0. From within the BAS console there is the functionality to perform the update of available users, this same functionality has not yet been extended to the BAA however it has been requested for addition to a future BAA version.

 

The current way to add a user that has been added before the BES has had time to index them would be to perform a refresh from the BAS console then proceed either via the BAA or the BAS console to actually add the user.

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
Posts: 17
Registered: ‎02-11-2009
My Device: Not Specified

Re: findMailStoreUsers cant find new users

Hi,

 

Try one thing, this might help u.

 

When u create a new user in exchange then immediately update the global address list like this in EMS:

 

update-GlobalAddressList "Default Global Address List"

 

after it try to get mail store users.

 

I think that BAA retreivs the mailboxe information from the GAL and a new user is not available in the GAL if you or the exchange server doesnt update the GAL. By default GALs are updated once in a day by system, so thats why i think its taking one day to show users to u in BAA (Thats my thought... may be its wrong).

Regards,
Laeeq Qazi
Team Lead (Exchange+BES) www.HostingController.com

New Developer
Posts: 7
Registered: ‎01-21-2010
My Device: Pearl

Re: findMailStoreUsers cant find new users

Hi,

 

that did not resolve it for me.  we still get the error that it could not find the user.

This worked just fine with the RES kit, why does it break in the API?

 

There must be a way to find a new user.

 

Eric

Contributor
Posts: 17
Registered: ‎02-11-2009
My Device: Not Specified

Re: findMailStoreUsers cant find new users

Hi,

 

So any one from RIM can shed some light on this issue?

 

This is really a big issue for those who want to switch to BES Admin API from BES Resource Kit (BESUserAdminClient.exe). IF BAA uses AD lookups then new users should be available in BAA immediately as it does in BAA Web Console and BRK.

 

 

Regards,
Laeeq Qazi
Team Lead (Exchange+BES) www.HostingController.com

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: findMailStoreUsers cant find new users

Hi Laeeq,

 

The BAA does not perform an AD look-up directly by default, nor does the BAS (although BAS does have a utility that will allow AD users to be added manually). AD is polled every 24 hours, so if a user is added they will not be found by default until this polling has occurred.

 

Beginning in BAS 5.0.2 the BAA has received the following call (located in the BAAEmail<Service> interface where <service> is Exchange, GroupWise or Domino):

addMailStoreUserFromCompanyDirectory(java.lang.String smtpAddress)

 

This will enable the user to be added to the BAS list of known AD users so they can have accounts created as soon as the user has been created in AD and has an SMTP address assigned.

 

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
Posts: 17
Registered: ‎02-11-2009
My Device: Not Specified

Re: findMailStoreUsers cant find new users

Hi,

 

First of all thanks alot for your prompt reply.

 

This will enable the user to be added to the BAS list of known AD users so they can have accounts created as soon as the user has been created in AD and has an SMTP address assigned.

 

As u said "the user to be added to the BAS list of known AD users" does it mean we have to still wait 24 hours in BAA or calling this method

 

addMailStoreUserFromCompanyDirectory(java.lang.String smtpAddress)

will also enable that user to be available to BAA so that we can add this AD user to BES immediately?

 

 

Regards,
Laeeq Qazi
Team Lead (Exchange+BES) www.HostingController.com

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: findMailStoreUsers cant find new users

Hi Laeeq,

 

Keep in mind that the BAA itself only offers a communication means to the BAS, it doesn't perform any actions itself. If a user is known to the BAS then a BES account can be created from either the BAA or BAS.

 

So making the call to addMailStoreUserFromCompanyDirectory() from the BAA will allow a BES user to be created both from the BAS directly or via a BAA call to the BAS immediately after returning successfully.

Garett
@garettBeuk
--
Goodbye everybody!