【问题标题】:New-PSSession localhost failed: WinRM cannot process the requestNew-PSSession localhost 失败:WinRM 无法处理请求
【发布时间】:2018-02-08 14:40:43
【问题描述】:

我有一个问题,我想在我的服务器上启动一个 New-PSSession。如果我在 powershell 中输入命令,我将收到以下错误:

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

为什么不能启动本地 PSSession?我已经检查了 winrm 配置,但没有帮助我。你能帮帮我吗?

谢谢

编辑 1 当我尝试与主机进行远程会话时出现的错误:

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


    【解决方案1】:

    这是以下内容的重复或极其相似的内容。

    New-PSSession 在本地无法工作我正在尝试连接到 本地主机使用 New-PSSession。

    New-PSSession does not work locally

    至于……

    为什么不能启动本地 PSSession?

    如果如上述帖子中所述,您可以正确设置所有内容。问题是你为什么会?

    远程会话(隐式/显式)专为让您以交互式和自动化方式访问远程主机而设计。

    您已经在本地主机上拥有它。那么,为什么要远离自己呢?这就像给自己写一封信然后邮寄给自己。

    我明白了,如果这是您唯一的设备并且您想练习玩远程会话,但除此之外,它不会给您带来任何好处。

    最后,对于加入域的服务器,这在 WS2K8 及更高版本上运行良好,当我对其进行测试时,它确实有效。对于非域机器/工作站,您将不得不跳过几圈。

    【讨论】:

    • 感谢您的评论!它没有帮助我。回答你的问题,“问题是你为什么要这样做?”我想在这里将另一台服务器连接到此主机,但我也收到错误消息,所以我想先在本地 test 它,即使这样也不起作用。所以如果我可以在本地解决这个问题,它也应该通过远程会话来解决。我已经从上面的远程问题中添加了错误。
    • 你说的是文章的指针,没有解决你的问题?至于您的报价,只要您是管理员并启用 PSRemoting 并确保您拥有所有防火墙规则,您就应该能够从远程框中执行此操作。但是,如果这些是工作组计算机,那么您必须在源和目标上采取更多步骤。 blogs.msdn.microsoft.com/wmi/2009/07/24/… --- 并且您的网络配置文件必须设置为私有。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-14
    • 2017-09-15
    • 2014-08-28
    • 2016-09-01
    • 2021-07-13
    • 2012-12-29
    相关资源
    最近更新 更多