Looking for help with a powershell api connectivity issue. The following code works for all customers, however, for one of the customers, it is returning an error:
var context = new WSManConnectionInfo(new Uri(uri),
"http://schemas.microsoft.com/powershell/Microsoft.PowerShell",
new PSCredential(username, securePassword))
{
SkipCACheck = true,
SkipCNCheck = true
};
using (var pool = RunspaceFactory.CreateRunspacePool(1, counterDefinitions.Count, context))
{
pool.Open();
pool.Open() line returns the following exception:
A first chance exception of type 'System.Management.Automation.Remoting.PSRemotingTransportException' occurred in System.Management.Automation.dll
Additional information: Processing data from remote server xxx.xx.xx.xx failed with the following error message: The request for the Windows Remote Shell with ShellId some-guid-number failed because the shell was not found on the server. Possible causes are: the specified ShellId is incorrect or the shell no longer exists on the server. Provide the correct ShellId or create a new shell and retry the operation. For more information, see the about_Remote_Troubleshooting Help topic.
If one is to examine the Intellitrace of the exceptions, the one exception thrown a little higher in the stack is as follows:
"The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". " (System.Runtime.InteropServices.COMException) A System.Runtime.InteropServices.COMException was thrown: "The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". "
Any thoughts as to what could be the problem? Customer has verified that winrm is running and configured, and that firewall has an open port, etc.
Server is running Windows Server 2012, as a VM on Azure