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();
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.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)