Error: ADFS Specify Configuration Database – An error occurred while checking if the database exist

Hello Readers

I have recently been playing with ADFS within my lab and ran into the following issue when specifying the Database instance I want to use for ADFS Data. The error I received was

An error occurred while checking if the database exists: Unable to connect to the database.


(1) have the SQL Administrator grant permissions to you to create the AD FS Configuration database in the specified SQL Server

(2) have the SQL Administator create the ADFS configuration database by running SQL scripts.

Option 1: Doesnt refer to the issue as I am using a service account with rights to the SQL Server.

Option 2: You can find out the full cmdlets here:

The command I will be using is

PS C:\> Export-AdfsDeploymentSQLScript -ScriptDestinationFolder “c:\script” -ServiceAccountName “lyncme\svc.adfs”


As you can see the Export was successful


You will now need to copy the files to your SQL Server and open SQL Management Studio


Connect to the SQL Instance you are trying to install ADFS Database to, in my case it is DB01\Core


Press New Query

You will need to open the sql script “Set Permissions” via notepad and copy and paste into the query


Press Execute

This command should complete successful and you will now need to return to the ADFS


Press OK to the Error and Press Next


Tick Overwrite existing ADFS Configuration Database Data and Press Next

You will now be able to successfully deploy ADFS on your server.

This concludes this post


Andrew Price

Leave a Reply

Your email address will not be published. Required fields are marked *