Fix the AD FS Export-FederationConfiguration.ps1 Database Error
Question details
The user needs to export the federation configuration during an AD FS 2.1 to AD FS 3.0 migration.

- Product
- Active Directory Federation Services (AD FS)
- Device & OS
- not provided
- Scenario
- Running Export-FederationConfiguration.ps1 from an AD FS server that uses a separate SQL Server configuration database.
- Observed behavior
- The script fails because it cannot read service-setting data from the configuration database.
Identify the AD FS server, the SQL Server instance hosting its configuration database, and the account that will run the export. Ask a SQL Server administrator to help verify connectivity and permissions.
Check SQL Server Connectivity and AD FS Database Permissions
Use this approach when the export script cannot read settings from a separate AD FS configuration database.
Sign in to the AD FS server with the account intended for the migration and open PowerShell. Navigate to the folder containing Export-FederationConfiguration.ps1.
Confirm that the AD FS server can reach the SQL Server instance hosting the configuration database. If SQL Server Management Studio is available, connect to that instance using the intended account and check that the database is accessible.
Ask the SQL Server administrator to review the account's access to the AD FS configuration database and grant the permissions required for the export. In the reported case, granting the account the SQL Server sysadmin role allowed the export to complete.
In PowerShell on the AD FS server, run the export script again with the parameters required for your migration. If needed, enter .\Export-FederationConfiguration.ps1 -? to review its syntax.

Document Your AD FS Migration with WPS Office
WPS Office does not fix AD FS or SQL Server permissions. It is a free, lightweight Office alternative with a familiar interface for maintaining migration notes and worksheets, and its Microsoft Office format support helps you move existing files seamlessly.

Frequently Asked Questions
Where should I run Export-FederationConfiguration.ps1?
Run the script from the AD FS server. Open PowerShell there and navigate to the folder containing the script before running it with the required migration parameters.
Why can the export fail when the AD FS database is on another server?
The AD FS server may be unable to reach the SQL Server instance, or the account running the script may lack database permissions. Check both connectivity and account access with the SQL Server administrator.
Does the export account always need the SQL Server sysadmin role?
Not necessarily. Sysadmin access resolved the reported case, but it grants broad privileges. Ask a database administrator to assess the required permissions and any temporary elevation.
Can WPS Office fix this AD FS database error?
No. The error requires AD FS and SQL Server connectivity or permission checks. WPS Office can be used separately to document the migration in files such as DOCX or XLSX.




