title: Remote PowerShell "WinRM cannot process the request." - works one way only
body: <p>I have been having trouble executing PowerShell script on a remote server. Basically, I have 2 servers <strong>SERVER-A</strong> and <strong>SERVER-B</strong>.</p>
  <p>Executing <strong>Invoke-Command</strong> and <strong>Enter-PSSession</strong> remote on SERVER-B works from SERVER-A, But I get * <strong>&quot;WinRM cannot process the request. The following error with error code 0x80090322 occurred while using Negotiate authentication: An unknown security error occurred...&quot;</strong> when I do the other way.</p>
  <p>I tried adding and removing SPN (HTTP &amp; WSMAN) entry in both server and tested in each scenario, it stayed the same.</p>
  <p>I did check the Firewall configuration and the windows remoting is enabled.</p>
  <p>The only difference between the server is that SERVER-A is on a Private network and SERVER-B is on the domain network. I can't change the SERVER-A network to the domain as I think it is a primary domain controller.</p>
  <p>I am a developer and do not have much experience in this field. Not sure how to make SERVER-B able to remote PowerShell in SERVER A.</p>
  <p><strong>EDIT</strong></p>
  <p>In the event viewer I see error:</p>
  <p>I tried the above steps. But I see in the event viewer error that the method of authentication used was Kerberos. I see error: &quot;<strong>The Kerberos client received a KRB_AP_ERR_MODIFIED error from the server SERVER$. The target name used was HTTP/SERVER.DOMAIN. This indicates that the target server failed to decrypt the ticket provided by the client. This can occur when the target server principal name (SPN) is registered on an account other than the account the target service is using. Ensure that the target SPN is only registered on the account used by the server. This error can also happen if the target service account password is different than what is configured on the Kerberos Key Distribution Center for that target service. Ensure that the service on the server and the KDC are both configured to use the same password. If the server name is not fully qualified, and the target domain (DOMAIN.LOCAL) is different from the client domain (DOMAIN.LOCAL), check if there are identically named server accounts in these two domains, or use the fully-qualified name to identify the server.</strong>&quot;</p>
  <p>Some suggested it might be due to client and DC time not being in sync, but I verified that it's the same.</p>