title: Azure AD Connect failing to configure AAD Sync
body: <p>While following the Azure AD Connect v1.1.189.0 installation wizard (<a href="https://azure.microsoft.com/en-us/documentation/articles/active-directory-aadconnect-version-history/" rel="nofollow">release history</a>), at "Configure" step, I receive the following message:</p>
  
  <blockquote>
    <p><strong>Create Federated AAD Trust</strong></p>
    
    <p>An error occurred while executing the 'Convert-MsolDomainToFederated' command. The underlying connection was closed: An unexpected error occurred on a send.</p>
  </blockquote>
  
  <p>When, I check the domain status by <code>Get-MsolDomain</code> I get</p>
  
  <blockquote>
    <p>Authentication: Federated</p>
  </blockquote>
  
  <p>When I retry, I get another error.</p>
  
  <blockquote>
    <p><strong>Configure AAD Sync</strong></p>
    
    <p>Element 'ma-run-data' was not found. Line 1, position 2.</p>
  </blockquote>
  
  <p>I returned the domain's Authentication to Managed using <code>Set-MsolDomainAuthentication -DomainName contoso.com -Authentication Managed</code>, uninstalled the Azure AD Connect and retried several times.</p>
  
  <ul>
  <li>ADFS and ADFS-WAP are already setup and working.</li>
  <li>Azure AD Connect server edition is 2012 R2 fully updated.</li>
  <li><a href="https://azure.microsoft.com/en-us/documentation/articles/active-directory-aadconnect-prerequisites/" rel="nofollow">Azure AD Connect perquisites</a> are met.</li>
  <li>No firewall ports/protocols are blocked or inspected.</li>
  <li>Tried with both .NET Framework 4.5.2 and .NET Framework 4.6.1.</li>
  </ul>