Home
Blackberry Enterprise Server Admin password reset
Blackberry (BES) Monday, 28 September 2015 by paul

Recently had an issue with accessing the Blackberry Administration Service site for administrating the BES (v5.0.4). It stopped accepting valid AD credentials and there were no "local" BAS user accounts configured with Administrator access.

The following T-SQL script executed against the BESMgmt database in SSMS will reset the BAS "admin" user password to "blackberry". It will also create the "admin" user if one cannot already be found in the table BASUsers.

DECLARE 
        @DisplayName              VARCHAR(256),
        @Authentication           VARCHAR(256),
        @AuthenticatorTypeId      INT,
        @AuthenticatorInstanceId  INT,
        @ExternalAuthenticatorId  VARCHAR(255),
        @EncryptedPassword        VARCHAR(256)
 
/************************************************************
Start of editing required section
*************************************************************/
 
SET @DisplayName =               'System Administrator'                  -- Display name (Not always used)
SET @Authentication =            'BAS'                                   -- 'BAS' for BAS authentication
SET @EncryptedPassword =        '7B7ECF0DAF70D040345D8DD92607E274969F4BA5DFDFAEAC5DE775E5340CDF605D5762EC5D326498ADBE72E7434897025A8702D0237046F554DBCA5769B90154:7637B189'      -- Encrypted string of password 'blackberry'
 
 
/************************************************************
End of editing required section
********/
 
IF @Authentication LIKE 'BAS'
BEGIN
        SET @AuthenticatorTypeId =      0                               -- Set to 0 for BAS
        SET @AuthenticatorInstanceId =   0                               -- Set to 0 for BAS
        SET @ExternalAuthenticatorId = NULL
 
      IF NOT EXISTS (SELECT * FROM BASUsers WHERE LoginName = 'admin')
             EXEC SetUpBASorADAuthentication @DisplayName, @AuthenticatorTypeId, @AuthenticatorInstanceId, @ExternalAuthenticatorId, @EncryptedPassword
        ELSE 
          UPDATE    BASUsers 
          SET       LoginPassword = @EncryptedPassword
          WHERE     (LoginName = 'admin')
 
END

Useful script allowed access to the Blackberry Administration site while the AD authentication issue was resolved. Change the admin password to a secure one ASAP after gaining access.


Add Comment
Tuesday, 29 December 2015 by Vincent McCullum
Hello Paul, Wanted to come here and thank you very much for this query. There were many places discussing this problem with resolutions centered around manual table manipulation. All of those solutions must have been missing something as yours worked perfectly. Furthermore, I had another issue where the BASusers table did not exist and was replaced with EASUsers. I took your query and modified the code to use EAS instead of BAS which solved my problem!! Hopefully this will save someone else a headache in the future. Here is the version that I ran in the event users see EASUsers instead of BASUsers: DECLARE @DisplayName VARCHAR(256), @Authentication VARCHAR(256), @AuthenticatorTypeId INT, @AuthenticatorInstanceId INT, @ExternalAuthenticatorId VARCHAR(255), @EncryptedPassword VARCHAR(256) /************************************************************ Start of editing required section *************************************************************/ SET @DisplayName = 'System Administrator' -- Display name (Not always used) SET @Authentication = 'EAS' -- 'BAS' for BAS authentication SET @EncryptedPassword = '7B7ECF0DAF70D040345D8DD92607E274969F4BA5DFDFAEAC5DE775E5340CDF605D5762EC5D326498ADBE72E7434897025A8702D0237046F554DBCA5769B90154:7637B189' -- Encrypted string of password 'blackberry' /************************************************************ End of editing required section ********/ IF @Authentication LIKE 'EAS' BEGIN SET @AuthenticatorTypeId = 0 -- Set to 0 for BAS SET @AuthenticatorInstanceId = 0 -- Set to 0 for BAS SET @ExternalAuthenticatorId = NULL IF NOT EXISTS (SELECT * FROM EASUsers WHERE LoginName = 'admin') EXEC SetUpEASorADAuthentication @DisplayName, @AuthenticatorTypeId, @AuthenticatorInstanceId, @ExternalAuthenticatorId, @EncryptedPassword ELSE UPDATE EASUsers SET LoginPassword = @EncryptedPassword WHERE (LoginName = 'admin') END