【发布时间】: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