Azure AD Connect – Getting “An error occurred while connecting to the state store” error after updating AAD connect configuration

image_thumb[1]Recently I had to update the configuration of an existing Azure AD Connect – the directly synchronization tool from Microsoft to synchronize your Active Directory identities to Azure AD – instance.

It was running the latest version at that time (1.5.42).

The error was:

An error occurred while connecting to the state store: Attempted to perform an unauthorized operation

It did not matter which type of configuration update I tried, I was always getting the error after completing the Azure AD Connect configuration wizard (when clicking the Configure button at the last step ‘Ready to configure’).

Then I noticed that a new version was released (1.5.45), s before further investigation and obviously opening a service request I upgraded the instance but still no luck.

It ended to be a permission issue on on file used by Azure AD Connect (PersistedState.xml located in C:\ProgramData\AADConnect)

To fix the issue, first take ownership of the file and then edit the permission to grant the Azure AD Connect service account full control.

Then you can run again the wizard to update your configuration and…Tada! Issue fixed.

Benoit Hamet
Benoit Hamet
Benoit is working on Microsoft collaborative technologies He has been awarded as MVP for more than 12 years Currently MVP on Office 365 after being awarded on SharePoint (2011-2012) and Windows client & server (2002-2007) Speaker at various Microsoft events (TechDays, TechNet seminars) and Quest Software He works on on-premises (Active Directory, RADIUS/NPS, Exchange, Skype for Business, SharePoint, SQL, Terminal Server, Windows client and Windows Server) or online (Azure, Intune, Office 365, Exchange Online, SharePoint Online, Skype for Business Online, Teams) technologies