Click here to Skip to main content
15,880,956 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hello I need a help to solve an issue...

To connect and execute exchange server 2010 management queries using C#, I was trying the following code. But I got the following Exception & I am unable to move forward.

C#
string password = "abc123";
string userName = @"india.local\Administrator";
SecureString ss = ConvertToSecureString(password);
PSCredential creds = new PSCredential(userName, ss);
WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri("http://192.168.1.194/powershell?serializationLevel=Full"), "http://schemas.microsoft.com/powershell/Microsoft.Exchange", creds);

connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Basic;

Runspace runspace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(connectionInfo);

runspace.Open();


Here is my exception.

C#
Connecting to remote server failed with the following error message : The WinRM client cannot process the request. Unencrypted traffic is currently disabled in the client configuration. Change the client configuration and try the request again. For more information, see the about_Remote_Troubleshooting Help topic.


Regards
Sebastian
Posted

1 solution

Hi,

please read this topic at SO, should also work for you:

http://stackoverflow.com/questions/1469791/powershell-v2-remoting-how-do-you-enable-unecrypted-traffic[^]

Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900