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

Article translations Article translations
Article ID: 2587730 - View products that this article applies to.
Expand all | Collapse all

PROBLEM

When you run the Set-MsolADFSContext -Computer cmdlet in the Windows 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 Windows Azure Active Directory Module for Windows PowerShell to set up single sign-on (SSO) from a management workstation by using Remote PowerShell. 

However, the Windows Azure Active Directory Module for Windows PowerShell can only be installed on Windows 7 and on Windows Server 2008 SR2. The Windows 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 Windows 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:
About_Remote_Requirements
For more information about Remote PowerShell functionality, go to the following Microsoft website:
Windows PowerShell: Dive Deep into Remoting
Still need help? Go to the Office 365 Community website or the Windows Azure Active Directory Forums website.

Properties

Article ID: 2587730 - Last Review: January 14, 2014 - Revision: 19.0
Applies to
  • Windows Azure
  • Microsoft Office 365
  • Microsoft Office 365 for enterprises (pre-upgrade)
  • Microsoft Office 365 for education  (pre-upgrade)
  • CRM Online via Office 365 E Plans
  • Windows Azure Recovery Services
Keywords: 
o365 o365a o365e o365062011 pre-upgrade o365022013 after upgrade o365m KB2587730

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com