Friday, 23 August 2013

Powershell Remoting: Transport Exception

Powershell Remoting: Transport Exception

Here's the code I'm using:
const string username = "domain\\user";
const string password = "password";
var credentials = new PSCredential(username, password.ToSecureString());
var connInfo = new WSManConnectionInfo(new
Uri("https://server.domain.com/powershell"),
"http://schemas.microsoft.com/powershell/Microsoft.Exchange", credentials)
{AuthenticationMechanism =
AuthenticationMechanism.Negotiate};
var rS = RunspaceFactory.CreateRunspace(connInfo);
rS.Open();
Here's the Exception:
Connecting to remote server server.domain.com failed with the following
error message: The WinRM client cannot process the request. The
authentication mechanism requested by the client is not supported by the
server or unencrypted traffic is disabled in the service configuration.
Verify the unencrypted traffic setting in the service configuration or
specify one of the authentication mechanisms supported by the server. To
use Kerberos, specify the computer name as the remote destination. Also
verify that the client computer and the destination computer are joined to
a domain. To use Basic, specify the computer name as the remote
destination, specify Basic authentication and provide user name and
password. Possible authentication mechanisms reported by server: For more
information, see the about_Remote_Troubleshooting Help topic.
So here's my confusion.
I checked the WSMan:\localhost\Client on the client computer, and made
sure AllowUnencrypted was $true.
I checked WSMan:\localhost\Service on the server and made sure
AllowUnencrypted was $true.
WSMan:\localhost\Service\Auth has Negotiate as well as Kerberos set to
$true as well.
What else can I check to get rid of the exception?

No comments:

Post a Comment