You are currently offline, waiting for your internet to reconnect

"The connection to <ServerName> Active Directory Federation Services 2.0 server failed" error when you use the Set-MsolADFSContext cmdlet

PROBLEM
When you run the Set-MsolADFSContext -Computer cmdlet in the Microsoft Azure Active Directory Module for Windows PowerShell, you receive the following error:
Set-MsolADFSContext : The connection to <ServerName> Active Directory Federation Services 2.0 server failed due to invalid credentials.
CAUSE
This error occurs if Remote PowerShell isn't enabled on the Active Directory Federation Services (AD FS) federation server that the -computer parameter references.

When a domain is added correctly and verified in the portal, you can use the Azure Active Directory Module for Windows PowerShell to set up single sign-on (SSO) from a management workstation by using Remote PowerShell. 

However, the Azure Active Directory Module for Windows PowerShell can only be installed on Windows 7 and on Windows Server 2008 SR2. The Azure Active Directory Module for Windows PowerShell can't be installed on Windows Server 2008 Service Pack 2 (SP2). Therefore, this problem is especially relevant where AD FS is installed on a Windows Server 2008 SP2 platform. In this case, the Azure Active Directory Module for Windows PowerShell command that's related to AD FS must be issued from a remote computer.
SOLUTION
To enable Remote PowerShell on the AD FS federation server, follow these steps:
  1. Start Windows PowerShell as an administrator. To do this, right-click the Windows PowerShell shortcut, and then click Run As Administrator.
  2. To set up Windows PowerShell for remoting, type the following command, and then press Enter:
    Enable-PSRemoting –force
MORE INFORMATION
For more information about Remote PowerShell requirements, go to the following Microsoft website:For more information about Remote PowerShell functionality, go to the following Microsoft website:Still need help? Go to the Office 365 Community website or the Azure Active Directory Forums website.
Properties

Article ID: 2587730 - Last Review: 12/12/2014 04:02:00 - Revision: 23.0

Microsoft Azure cloud services, Microsoft Azure Active Directory, Microsoft Office 365, Microsoft Intune, CRM Online via Office 365 E Plans, Microsoft Azure Recovery Services, Office 365 Identity Management

  • o365 o365a o365e o365022013 o365m KB2587730
Feedback
Active Directory Federation Services server failed due to invalid credentials" error in Azure Active Directory Module for Windows PowerShell." />
Active Directory Federation Services server failed due to invalid credentials" error in Azure Active Directory Module for Windows PowerShell." />
dy>0';m.content='true';document.getElementsByTagName('head')[0].appendChild(m);" onload="var m=document.createElement('meta');m.name='ms.dqp0';m.content='false';document.getElementsByTagName('head')[0].appendChild(m);" src="http://c1.microsoft.com/c.gif?"> y>=">