Score:0

Connecting to remote server failed: The WinRM client cannot process the request

cz flag

I am trying to execute a powershell script on a remote server from my local machine, however I get an error. Here is the full error message:

Connecting to remote server failed with the following error message : The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.

  • CategoryInfo : OpenError: (:String) [], PSRemotingTransportException
  • FullyQualifiedErrorId : ServerNotTrusted,PSSessionStateBroken

Now this is a common error and I found lots of information on it already, however none lead to a successful connection. What I have done:

  • In an elevated PowerShell window
  • Started WinRM on both machines
  • Checked the port where the remote machine is listening with:

winrm enumerate winrm/config/listener

  • Added the remote machine to my trusted hosts on the local machine
  • All done with administrator privileges
  • Both machines are on the same domain

The remote machine is a VM hosted on Azure, but that should not matter. The ports are not getting blocked on the firewall either.

I am really not sure what else to check for right now. Any help would be appreciated!

Vitas avatar
jp flag
can you post result from winrm enumerate winrm/config/listener ?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.