Powershell Remoting: Transport Exception -
here's 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 exception:
connecting remote server server.domain.com failed following error message: winrm client cannot process request. authentication mechanism requested client not supported server or unencrypted traffic disabled in service configuration. verify unencrypted traffic setting in service configuration or specify 1 of authentication mechanisms supported server. use kerberos, specify computer name remote destination. verify client computer , destination computer joined domain. use basic, specify computer name remote destination, specify basic authentication , provide user name , password. possible authentication mechanisms reported server: more information, see about_remote_troubleshooting topic.
so here's confusion.
- i checked wsman:\localhost\client on client computer, , made sure allowunencrypted $true.
- i checked wsman:\localhost\service on server , made sure allowunencrypted $true.
- wsman:\localhost\service\auth has negotiate kerberos set $true well.
what else can check rid of exception?
i have no way test this, after looking @ example @ msdn blog, seems need update conninfo
line add servername, no matter credentials choose use.
var conninfo = new wsmanconnectioninfo(new uri("https://server.domain.com/powershell", add_server_name_here), "http://schemas.microsoft.com/powershell/microsoft.exchange", credentials) { authenticationmechanism = authenticationmechanism.negotiate };
Comments
Post a Comment