New-PSSession localhost failed: WinRM cannot process the request

-1

I've got the problem that i want to start an New-PSSession on my server. If i enter the command in powershell i will get the following error:

New-PSSession : [localhost] Connecting to remote server localhost failed with
the following error message : WinRM cannot process the request. The following
error with errorcode 0x80090322 occurred while using Negotiate authentication:
An unknown security error occurred.
 Possible causes are:
  -The user name or password specified are invalid.
  -Kerberos is used when no authentication method and no user name are
specified.
  -Kerberos accepts domain user names, but not local user names.
  -The Service Principal Name (SPN) for the remote computer name and port does
not exist.
  -The client and remote computers are in different domains and there is no
trust between the two domains.
 After checking for the above issues, try the following:
  -Check the Event Viewer for events related to authentication.
  -Change the authentication method; add the destination computer to the WinRM
TrustedHosts configuration setting or use HTTPS transport.
 Note that computers in the TrustedHosts list might not be authenticated.
   -For more information about WinRM configuration, run the following command:
winrm help config. For more information, see the about_Remote_Troubleshooting
Help topic.
At line:1 char:1
+ New-PSSession
+ ~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:Re
   moteRunspace) [New-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : -2144108387,PSSessionOpenFailed

Why isn't it possible to start a local PSSession? I've already checked the winrm config but didn't helped me. Can you might help me?

Thanks

EDIT 1 The error i get when i try to make a remote session to the host:

PS C:\Windows\system32> Invoke-Command -ComputerName xxxxxx.xxxxxxx.net {Hostname}
[xxxxxx.xxxxxxx.net] Connecting to remote server xxxxxx.xxxxxxx.net failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090322 
occurred while using Kerberos authentication: An unknown security error occurred.  
 Possible causes are:
  -The user name or password specified are invalid.
  -Kerberos is used when no authentication method and no user name are specified.
  -Kerberos accepts domain user names, but not local user names.
  -The Service Principal Name (SPN) for the remote computer name and port does not exist.
  -The client and remote computers are in different domains and there is no trust between the two domains.
 After checking for the above issues, try the following:
  -Check the Event Viewer for events related to authentication.
  -Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport.
 Note that computers in the TrustedHosts list might not be authenticated.
   -For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (xxxxxx.xxxxxxx.net:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : -2144108387,PSSessionStateBroken
powershell
authentication
localhost
winrm
asked on Stack Overflow Feb 8, 2018 by tobifree • edited Feb 9, 2018 by tobifree

1 Answer

0

This is either a duplicate of the below or extremely close similarity.

New-PSSession does not work locally I am trying to connect to the localhost using New-PSSession.

New-PSSession does not work locally

As for ...

Why isn't it possible to start a local PSSession?

You can, if as noted in the above post, all things are set correctly. The question is why would you?

Remote sessions (implicit / explicit) are specifically designed to give you interactive and automation access to a remote host.

You already have that on a localhost. So, why remote into yourself? This would be like writing yourself a letter and then mailing it to yourself.

I get this, if this is your only device and you want to practice playing around with remote sessions, but beyond that, it does not buy you anything.

Lastly, for domain joined servers, this just works, well on WS2K8 and higher, well when I tested them it does. For non-domain machines/workstations, you are going to have to jump through a few hoops.

answered on Stack Overflow Feb 9, 2018 by postanote • edited Feb 9, 2018 by postanote

User contributions licensed under CC BY-SA 3.0