本文介绍了Enable-PSRemoting 后无法创建远程 powershell 会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法远程进入任何机器来挽救我的生命!我已经尝试了我能找到的一切.如果有人可以对我进行故障排除或指导,我将不胜感激,因为这将是添加到我的域中的绝佳工具.

设置:

  1. 域内的客户端机器
  2. 服务器域内或域外机器 - 虚拟化并用于 WSUS 计算机名称:wsustest
  3. CLIENT SERVER MACHINE 物理计算机名称:epizzi-pc

步骤:

启用 pssremoting 完成!在所有机器上配置了 * 的受信任主机或添加了客户端计算机关闭公共配置文件的防火墙以防万一

Enter-PSSession -ComputerName wsustest -Credential wsustest\administratorEnter-PSSession -ComputerNameepizzi-pc -Credentialepizzi-pc\administradorEnter-PSSession:连接到远程服务器epizzi-pc 失败并显示以下错误消息:WinRM 无法处理请求.错误代码为 0x80090311 的以下错误使用 Kerberos 身份验证时发生:当前没有可用于为登录请求提供服务的登录服务器.可能的原因有:- 指定的用户名或密码无效.-Kerberos 在未指定身份验证方法和用户名时使用.-Kerberos 接受域用户名,但不接受本地用户名.- 远程计算机名称和端口的服务主体名称 (SPN) 不存在.- 客户端和远程计算机在不同的域中,两个域之间不存在信任.检查上述问题后,请尝试以下操作:- 检查事件查看器是否有与身份验证相关的事件.- 更改认证方式;将目标计算机添加到 WinRM TrustedHosts 配置设置或使用 HTTPS 传输.请注意,TrustedHosts 列表中的计算机可能未经过身份验证.- 有关 WinRM 配置的更多信息,请运行以下命令:winrm help config.有关详细信息,请参阅 about_Remote_Troubleshooting 帮助主题.在行:1 字符:1+ Enter-PSSession -ComputerNameepizzi-pc -Credentialepizzi-pc\administrador+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidArgument: (epizzi-pc:String) [Enter-PSSession], PSRemotingTransportException+ FullQualifiedErrorId : CreateRemoteRunspaceFailed

Enter-PSSession -ComputerName wsustest -UseSSL -Credential wsustest\administrator*Enter-PSSession :连接到远程服务器 wsustest 失败并显示以下错误消息:WinRM 无法完成操作.验证指定的计算机名称是否为有效,计算机可通过网络访问,并且启用了 WinRM 服务的防火墙例外并允许从这台计算机访问.默认情况下,WinRM公共配置文件的防火墙例外限制了对同一本地子网中的远程计算机的访问.有关详细信息,请参阅 about_Remote_Troubleshooting 帮助主题.在行:1 字符:1+ Enter-PSSession -ComputerName wsustest -UseSSL -Credential wsustest\administrato ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidArgument: (wsustest:String) [Enter-PSSession], PSRemotingTransportException+ FullQualifiedErrorId : CreateRemoteRunspaceFailed*错误:

解决方案

我在远程连接到服务器时遇到了同样的问题,发现这篇博文非常有帮助 - http://jeffgraves.me/2013/10/14/powershell-remoting/

对于我的具体情况,我做了以下事情:

在本地机器上

  1. winrm quickconfig(虽然已经配置了)
  2. winrm s winrm/config/client '@{TrustedHosts="myservername.domain"}'

在远程机器上

  1. 启用-psremoting -force
  2. Set-PSSessionConfiguration -ShowSecurityDescriptorUI -Name Microsoft.PowerShell -Force

I can not remote into any machine to save my life! I have tried everything I can find. If anyone could troubleshoot or guide me, I'd appreciate it as this would be a great tool to add on my domain.

SETUP:

  1. Client machine inside domain
  2. Server machine inside or outside domain - Virtualized and utilized for WSUS Computername: wsustest
  3. CLIENT SERVER MACHINE physical- computername: epizzi-pc

STEPS:

enable-pssremoting done! on all machines
trustedhosts configured with * or client machine added
Firewalls with public profile off just in case


Enter-PSSession -ComputerName wsustest -Credential wsustest\administrator
Enter-PSSession -ComputerName epizzi-pc -Credential epizzi-pc\administrador
Enter-PSSession : Connecting to remote server epizzi-pc failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090311 
occurred while using Kerberos authentication: There are currently no logon servers available to service the logon request.  
 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
+ Enter-PSSession -ComputerName epizzi-pc -Credential epizzi-pc\administrador
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (epizzi-pc:String) [Enter-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed


Enter-PSSession -ComputerName wsustest -UseSSL -Credential wsustest\administrator

*Enter-PSSession : Connecting to remote server wsustest failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is 
valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM 
firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName wsustest -UseSSL -Credential wsustest\administrato ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (wsustest:String) [Enter-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed*
ERRORs:
解决方案

I was receiving the same problem when remoting to a server and found this blog post very helpful - http://jeffgraves.me/2013/10/14/powershell-remoting/

For my specific case I did the following:

On the Local machine

  1. winrm quickconfig (although this was already configured)
  2. winrm s winrm/config/client '@{TrustedHosts="myservername.domain"}'

On the Remote machine

  1. enable-psremoting -force
  2. Set-PSSessionConfiguration -ShowSecurityDescriptorUI -Name Microsoft.PowerShell -Force

这篇关于Enable-PSRemoting 后无法创建远程 powershell 会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 23:23