Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

BitLocker recovery key cannot be retrieved from the MBAM Self-Service Portal: "There was error contacting the MBAM database"

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

A user is locked out at the BitLocker recovery screen. The support process says to go to the Microsoft BitLocker Administration and Monitoring (MBAM) Self-Service Portal, which hands out the recovery key. The portal page either fails to open or opens and answers with this message:

There was error contacting the MBAM database. Please try again later.

Microsoft's page for this symptom is titled "Users cannot retrieve BitLocker Recovery key using MBAM 2.0 Self Service Portal". It names two causes, both on the server that hosts the portal, not on the user's computer. The checks that only read come first, and the two changes Microsoft describes follow.

What the error means

The portal is a web application on a server. Microsoft's page says: "If a user attempts to open MBAM 2.0 Self Service Portal web page to retrieve BitLocker Recovery Key, the web page may fail to open." The message in the box above is shown in addition to that failure. The words in the message say the web application could not talk to the database that holds the MBAM data. The page then gives the two reasons the connection fails.

The status of the product matters to anyone still running it. Microsoft's MBAM 2.5 overview says: "Extended support for MDOP ends on April 14, 2026" and that the functionality of MBAM "has been incorporated into Microsoft Configuration Manager as Microsoft Configuration Manager BitLocker Management". It adds that customers not using Configuration Manager can use the built-in features of Microsoft Entra ID and Microsoft Intune to administer and monitor BitLocker. The overview page is dated 2024-08-12; check the current page for what applies at the time you read this. The troubleshooting page covers MBAM 2.0 by name and does not say whether it applies to 2.5.

Likely causes

Microsoft states: "This problem can occur for two possible reasons".

Cause What it looks like Microsoft's wording
Windows Firewall blocks the web server's traffic to SQL Server The error above, plus an application log entry on the server with the portal feature "Windows Firewall is blocking the traffic from machine to SQL Server."
The User Support Service web.config has no connection string The same user-facing error, with no connection details in the file "User Support Service web.config file does not have connection string information."

The page does not say which cause is more frequent, so the rows are not ranked.

For the firewall cause, the page quotes the log entry to look for on the server where the portal feature is installed: "Exception message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)".

Prove the cause before changing anything

All of these only read.

  1. On the server that hosts the Self-Service Portal feature, read the application event log for the exception message above. Microsoft ties that text to the firewall cause. If it is there, go to the firewall fix. If the log has no such exception and the portal still fails, check the second cause.
  2. Open the User Support Service configuration file. The page gives the location as c:\inetpub\MicrosoftBitLockerManagementSolution\UserSupportService, and the file is web.config. Look at the <connectionStrings> block. The page says the entry named ComplianceStatusConnectionString should carry connection information and that the faulty state is connectionString="", an empty value.
  3. Note which SQL Server and which database the MBAM Compliance Status database is. The page's fix needs the SQL Server name and the name of the MBAM Compliance Status database, and tells you to replace the placeholders in its example with them.
  4. Find out which port SQL Server uses. The page says: "By default SQL uses port 1433 if you have configured SQL with a default instance." A named instance or a changed port needs its own port allowed instead; the page does not cover that case.
  5. Check the MBAM version. The page says MBAM 2.0.

Example (illustrative): at a professional-services firm in Brisbane, the helpdesk sends a user to the portal and gets "There was error contacting the MBAM database". The web server's application log shows error 40, Could not open a connection to SQL Server, which matches the firewall cause. A second site with the same message finds connectionString="" in web.config and no such log entry, which matches the second cause.

Fix

Use the section that matches the proof. Do both only if both were found.

Windows Firewall blocking SQL Server traffic

Risk: the next change, adding a firewall rule that allows SQL Server traffic, widens what the SQL Server computer accepts from the network. Allow the port only from the portal server, and write down the rule name and port you add so it can be removed.

Microsoft's fix is to "Open firewall ports for SQL Server" and its page links to a separate article, "Configuring the Windows Firewall to Allow SQL Server Access", for the steps. Microsoft's MBAM page gives no rule name, scope or command of its own, so none is given here.

Follow Microsoft's linked page for the firewall on the SQL Server computer and open the port that the instance uses. For a default instance the port named on the MBAM page is 1433.

To undo it: delete the rule you added, using the name you recorded. Nothing else on the SQL Server computer changes with the rule.

Empty connection string in web.config

Risk: the steps below edit the configuration file of the production Self-Service Portal and then restart IIS on the server. A mistake in the connection string leaves the portal failing, and the restart interrupts any other site and any request in progress on that IIS server. Do it outside business hours and at a time when no one is waiting for a recovery key.

First save the file as it is. The page says "Make a copy of web.config file". From an elevated command prompt on the portal server, using the copy command described on Microsoft's command reference as copy <source> <destination>:

copy c:\inetpub\MicrosoftBitLockerManagementSolution\UserSupportService\web.config c:\inetpub\MicrosoftBitLockerManagementSolution\UserSupportService\web.config.bak

Then make the change:

  1. Edit web.config and set the connection string information in the <connectionStrings> block. The page gives the correct entry in this form, with the SQL Server name and the MBAM Compliance Status database name replaced for your environment:
<add name="ComplianceStatusConnectionString" providerName="System.Data.SqlClient" connectionString=" Data Source=<SqlServerName>;Initial Catalog=&quot;<ComplianceStatusDatabaseName>&quot;;Integrated Security=SSPI;"/>

The page's own worked example uses the names MBAMSQL and MBAM_Comp_DB, but it writes the value with square brackets, asterisks and extra spaces around the database name. Treat that example as unclear and follow the first form above, with your own names.

  1. Save web.config.
  2. Restart IIS Services on the server, as the page instructs. The page gives no command for it.

To undo it: restore the copy over web.config, leaving web.config.bak in place (the copy page describes /y as suppressing the prompt to confirm an overwrite), then restart IIS again so the old file is read. The restart itself has no undo.

copy /y c:\inetpub\MicrosoftBitLockerManagementSolution\UserSupportService\web.config.bak c:\inetpub\MicrosoftBitLockerManagementSolution\UserSupportService\web.config

Confirm the fix

Microsoft's expected result: "Now user should be to retrieve BitLocker Recovery key successfully from MBAM SSP webpage." Check each of these:

  • The Self-Service Portal page opens from a client computer.
  • A test user, with a device whose key is in MBAM, can reach the recovery key lookup and does not receive "There was error contacting the MBAM database".
  • The application event log on the portal server stops recording error 40 from the Named Pipes provider.
  • The portal still works after the server restarts, so the fix does not depend on a session.

What to watch afterwards

  • The recovery process on the day it is needed. A user without access to the portal has no key, so test the portal on a schedule and not only when someone is locked out.
  • Support dates. The MBAM overview says extended support for MDOP ends on April 14, 2026. A device fleet that depends on MBAM for recovery keys needs a plan that moves keys to a supported place. The BitLocker recovery overview says the recovery password can be saved in Microsoft Entra ID for Microsoft Entra joined devices and in AD DS for devices joined to Active Directory, depending on policy settings.
  • Changes to the SQL Server computer: a rename, a new instance or a moved database makes the same message come back, because the connection string and the firewall rule are tied to them. This is our own general advice, not a statement on Microsoft's page.

Risks and limits

These steps have not been run or lab-tested.

The troubleshooting page covers MBAM 2.0 and describes a Windows Firewall issue and a missing connection string. It gives no steps for the firewall rule, no command to restart IIS, no ranking of the causes, and its connection string example contains symbols that do not match its own first form. It does not say whether the message has other causes. The MBAM 2.5 overview page gives April 14, 2026 as the end of extended support and points to Configuration Manager, Entra ID and Intune; moving between them is a separate job that Microsoft's MBAM page does not describe. Editing the production web application's configuration and restarting IIS affect every user of that server, so schedule the work and keep the copy of web.config until the portal has been confirmed working.

Sources