When upgrading Azure AD Connect (ADSync), the wizard fails with the error: “Failed to load configuration information from primary ADFS server”.


This can happen if the federation service was moved to a different machine after installing Azure AD Connect. Subsequent updates to the synchronization service fail with the above error message. This is because AD Connect stores the name of the original ADFS server in the PersistedState XML file.

The fils is located at: C:\ProgramData\AADConnect\PersistedState.xml

The ADFS servername is stored in the IAdfsContext.TargetAdfsServers property, oh and it’s Base64 encoded. PowerShell can be used to easily read the file:

[xml]$xml = Get-Content "C:\ProgramData\AADConnect\PersistedState.xml"


Simply update the value of the IAdfsContext.TargetAdfsServers with the servername of the new ADFS machine, as the servername has to be Base64 encoded, the following PowerShell code can be used to convert a string:

$name = "adfs01.example.com"