“Failed to connect to Active Directory Federation Services 2.0 on the local machine” error when you run the Convert-MsolDomainToStandard cmdlet

Applies to: Office 365 Identity ManagementCloud Services (Web roles/Worker roles)Microsoft Intune More

PROBLEM


When you run the Convert-MsolDomainToStandard cmdlet to convert a domain from federated to managed, you receive the following error message:
Failed to connect to Active Directory Federation Services 2.0 on the local machine.
Please try running Set-MsolADFSContect before running this command again.

CAUSE


This problem occurs if the server on which you're running the Convert-MsolDomainToStandard cmdlet is not running Active Directory Federation Services (AD FS).

SOLUTION


Do one of the following, as appropriate for your situation:
  • If AD FS is still running, use the Set-MsolADFSContext cmdlet to specify the server on which AD FS is running.

    For example:
    Set-MsolADFSContext –Computer <ServerName>  
    For more information about the Set-MsolADFSContext cmdlet, see Set-MsolADFSContext.
  • If AD FS is not running, use the Set-MsolDomainAuthentication cmdlet to change the domain to a managed domain.

    For example:
    Set-MsolDomainAuthentication -DomainName <DomainName> -Authentication Managed 
    For more info about the Set-MsolDomainAuthentication cmdlet, see Set-MsolDomainAuthentication.

MORE INFORMATION


Still need help? Go to Microsoft Community or Azure Active Directory Forumswebsite.