User Realm Discovery Failed – AAD Connect Error

How to fix the User realm discovery failed error while configuring Azure AD Connect. 


I was at a customer site upgrading the DirSync solution into Azure AD Connect platform by doing a parallel deployment. The environment had a proxy and was WPAD aware. While configuring AAD Connect, the error popped up!

We encountered a problem and couldn't complete the integration. An error occurred executing Configure AAD Sync task : user_realm_discovery_failed: User realm discovery failed.

user realm discovery failed error

While all the online solutions was pointing to configuring a proxy url and port in the machine.config file within ​C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Config on the AAD Connect server, I wanted to configure the server not to use a proxy. The customer had moved the proxy solution to a next gen firewall, but the environment had the "remains" of the WPAD configuration ;)

My solution was to navigate to C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Config and open the machine.config file using notepad (run as administrator). The below code was added just above the </configuration> tag and AAD Connect got past the configuration page with no issues.​


<defaultProxy enabled="false"></defaultProxy>


Machine.config file AAD Connect

[clickToTweet tweet=”Fix User Realm Discovery Failed Error in Azure AD Connect” quote=”Fix User Realm Discovery Failed Error in Azure AD Connect”]


Rajith Enchiparambil

Cloud Architect & Blogger with interests in Microsoft 365, AWS & Azure. I am active on Experts Exchange & TechNet forums and I am a technical author for SearchExchange. Follow me on TwitterLinkedIn or Facebook for the latest updates. For consultancy opportunities, drop me a line.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.