title | description | ms.date | manager | audience | ms.topic | localization_priority | ms.reviewer | ms.custom |
---|---|---|---|---|---|---|---|---|
Error when you use the Set-MsolADFSContext command |
Describes an issue in which you receive an error message when you use the Set-MsolADFSContext command. |
12/26/2023 |
dcscontentpm |
itpro |
troubleshooting |
medium |
kaushika, brheld |
sap:Windows Security Technologies\Active Directory Federation Services (AD FS) non-Azure-O365 issues, csstroubleshoot, has-azure-ad-ps-ref |
Error when you use the Set-MsolADFSContext command: The connection to <ServerName> Active Directory Federation Services 2.0 server failed
Applies to: Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Original KB number: 2587730
When you run the Set-MsolADFSContext -Computer
command 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.
[!INCLUDE Azure AD PowerShell deprecation note]
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.
To enable Remote PowerShell on the AD FS federation server, follow these steps:
-
Start Windows PowerShell as an administrator. To do this, right-click the Windows PowerShell shortcut, and then select Run As Administrator.
-
To set up Windows PowerShell for remoting, type the following command, and then press Enter:
Enable-PSRemoting -force
For more information about Remote PowerShell requirements, see About_Remote_Requirements.
For more information about Remote PowerShell functionality, see Windows PowerShell: Dive Deep into Remoting.
Still need help? Go to Microsoft Community or the Microsoft Entra Forums website.