SQL query to find BES UserID

Had a support call today about a user not receiving email on his Blackberry device.  After a phone call to Research in Motion, we determined the user was out of the coverage area.  Very frustrating.  All the information was in the Blackberry Enterprise Server’s MAGT log, I just didn’t know how to find it.  Here’s how I figured it out.

Previously I had posted the following SQL query that determines a user’s name based upon the BES ID number.

SELECT     Id, DisplayName, UserName
FROM         UserConfig
WHERE     (Id = ‘73′)

I changed the query around to find the BES UserID based upon the UserName:

SELECT     Id, DisplayName, UserName
FROM         UserConfig
WHERE     (UserName = ‘jsmith’)

This query gave me the BES UserID, which was 779 in my case.

I then opened up the BES MAGT log, and searched for the following string:

UserId: 779 is out of coverage

I found it repeatedly.  My user was out of coverage all day, which is why no mail  was received on his Blackberry.

Fix: Blackberry Media Manager exits with R6025 pure virtual function call error

My Blackberry Media Manager kept exiting on me when trying to access the Media stored on my Blackberry Storm.  The specific error was:

Microsoft Visual C++ Runtime Library X Runtime Error!

Program: C:\program Files\Roxio\Media Manager 9\Mediamanager9.exe

R6025 – pure virtual function call

The problem ended up being that the RoxMediaDB9 service was disabled.

I changed the service from disabled to manual (could have been set to automatic if I wanted it to start following each reboot), started the RoxMediaDB9 service, which allowed Media Manager to start without issue.

SQL Query to determine Blackberry MDS Services administration password

I was troubleshooting a Blackberry Manager problem today that required the BES MDS credentials.  The admin thought he knew what the credentials were, but wasn’t sure.  So I wrote the following SQL query and ran it against the Blackberry Enterprise Server’s BesMgmt database to get the user name and password:  

Use BesMgmt
WSAdminUserName, WSAdminPassword
from dbo.MDSAGConfig
Replace BesMgmt with the name of your BES database if you are not using the default database name.
See RIM KB15618 for additional details on how to reset the BES MDS Services administration password.

Fix: Cannot find Groupwise users to add to the Blackberry Enterprise Server

A user was recently having issues with his Groupwise email on his Blackberry, so our BES admin planned on removing him from BES, then re-adding him.  Removing the user was no problem, but the admin was quite suprised to find out he could not re-add the user.  When searching for the user to add, the user was not found. 

I found RIM KB12111, which describes running GWSystemAddressBookSync.exe manually to resynchronize the Blackberry Configuration Database with the Groupwise System Address Book.  By default this process runs every 12 hours.
The user in question was not a new user, but running the manual synchronization allowed the BES admin to find the user and re-add him onto BES.
By default you can find the GWSystemAddressBookSync.exe program in the C:\Program Files\Research in Motion\Blackberry Enterprise Server directory on the BES server.  Run the .exe from the command prompt and wait for the process to finish.  

My BES is version 4.1.14 with 180 users, and my Groupwise System is version 7.0.3 hot patch 1 with 2600 users, and the sync process took about 14 minutes to complete when run during production hours.

After upgrading to BES 4.1.3 or higher for Groupwise, excessive GWXMLData::ContactSyncRecordToXML warnings appear in the Windows Application log

Blackberry KB15941 exlains that starting with BES 4.1, additional warnings are logged to the Blackberry Messaging and Windows Application log.  These warnings are informational in nature, and do not indicate a problem.

If you’d like to reduce or eliminate these messages, KB04342 says to edit the EventLogLevel DWORD value  of the appropriate BES service located at : 

HKEY_LOCAL_MACHINE\Software\Research In Motion\Blackberry Enterprise Server\Logging Info
DWORD values and Event Types correspond as follows:
0 = Disable all event logging
1 = Errors
2 = Warnings
3 = Information
4 = Debug
5 = Other
Unforturnately, I was unable to determine which service was generating these excessive GWXMLData warnings, so I had to contact RIM directly.  Their response was that the Mailbox Agent service needs to have it’s EventLogLevel changed to 1, which would log errors only.
I made this change on my BES server, and the event logs are now much slimmer!

Viewing Pending Messages by user in Blackberry Manager

After our recent upgrade of our Blackberry Enterprise Server from version 4.0.7 to 4.1.14, I  noticed the total pending message counts shown in the BES MAGT log file never droppped below 275.  I was concerned about this, thinking that the server was busy and could never get all messages processed, even during times of light usage, like in the middle of the night.  

I later found that the Pending Data Packets field can be added within Blackberry Manager.  This allowed me to sort by users with the most pending messages.  Identifying these users, and corresponding the Last Contact Time allowed me to determine which users are probably no longer with the company.  A quick call to HR verified my hypothesis, and after removing these users my pending message counts dropped to a more reasonable amount.
To view the BES pending message counts:
1.  Launch Blackberry Manager
2.  Highlight the BES server name, and select Users
3.  From the View menu, select Choose Columns
4.  Under Available Columns, select Pending Data Packets and click  Insert > OK
5.  Click the Pending Data Packets column to sort by users with the most pending requests.

The correct order to stop and start BES services

KB 13718 explains the correct order to stop and start Blackberry Enterprise Server (BES) services for Microsoft Exchange:

1. BlackBerry Router.
2. BlackBerry Dispatcher.
3. BlackBerry Controller.
4. All remaining BlackBerry services.

The BlackBerry Enterprise Server for Microsoft Exchange Disaster Recovery Guide explains the correct order is:

1. BlackBerry Controller
2. BlackBerry Router
3. BlackBerry Dispatcher
4. all remaining BlackBerry services

KB04293 explains the correct order for BES 4.0 or later with Exchange is:

1. BlackBerry Router
2. BlackBerry Dispatcher
3. BlackBerry Controller
4. all other BlackBerry Enterprise Server services

The BlackBerry Enterprise Server for IBM Lotus Domino Version 4.1.3 Upgrade Guide explains the correct order is:

1. BlackBerry Controller
2. BlackBerry Router
3. BlackBerry Dispatcher
4. all remaining services

I was unable to find any official Blackberry documentation regarding the proper order to stop and start the BES services for Groupwise, but this document on the Vodaphone support web site suggests the following order:

Start the Blackberry services in the following order:

1. Blackberry Dispatcher
2. Blackberry Router
3. Blackberry Controller
4. Blackberry Alert
5. Blackberry Attachment Service
6. Blackberry Mobile Data Service
7. Blackberry Policy Service
8. Blackberry Synchronization Service

Reverse the order of the services when you stop the services.

As you can see, the documentation does not consistently explain the order the BES services should be stopped and started.