powershell - 如何在本地计算机上使用 PowerShell invoke-command 远程运行的 Minecraft 服务器中输入命令?

标签 powershell remote-access minecraft

我正在从我的笔记本电脑上运行 Minecraft 服务器,因为它具有 i7 处理器,并且内存比我的台式机更多。我希望能够在桌面上看到服务器命令行,并能够在服务器实际在我的笔记本电脑上运行时输入命令。我能够通过设置远程访问并运行命令来查看命令行

Invoke-Command -ComputerName 10.0.0.53 -Credential Admin -ScriptBlock { & "RUNSERVER.bat"}

这使得我能够看到服务器正在向我的桌面上的 PowerShell 窗口输出什么,并且服务器像它应该的那样在笔记本电脑上运行,但我仍然无法输入任何命令。我对 PowerShell 非常缺乏经验,所以我不太确定从这里该去哪里。有人知道如何编辑它以便我可以从桌面上的 PowerShell 窗口输入命令吗?

[localhost] Connecting to remote server localhost failed with the following error message : WinRM cannot process the request. The following error with
errorcode 0x8009030d occurred while using Negotiate authentication: A specified logon session does not exist. It may already have been terminated.
 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: (localhost:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : 1312,PSSessionStateBroken
[localhost] Connecting to remote server localhost failed with the following error message : The WinRM client cannot process the request. CredSSP authentication
is currently disabled in the client configuration. Change the client configuration and try the request again. CredSSP authentication must also be enabled in
the server configuration. Also, Group Policy must be edited to allow credential delegation to the target computer. Use gpedit.msc and look at the following
policy: Computer Configuration -> Administrative Templates -> System -> Credentials Delegation -> Allow Delegating Fresh Credentials.  Verify that it is
enabled and configured with an SPN appropriate for the target computer. For example, for a target computer name "myserver.domain.com", the SPN can be one of
the following: WSMAN/myserver.domain.com or WSMAN/*.domain.com For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (localhost:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : -2144108126,PSSessionStateBroken
2019-04-19 20:00:08,630 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2019-04-19 20:00:08,631 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

最佳答案

输入 PSSession -计算机名“笔记本电脑”

您现在位于通过计算机名称参数识别的计算机上的远程 Powershell session 中。

一些需要注意的事情。如果您在工作组而不是域中执行此操作,您将需要处理传递凭据的问题。您必须将它们作为 PS 中的凭据对象传递。所以它看起来更像是这样的:

$Creds = Get-Credential
enter-pssession -ComputerName 10.0.0.53 -Credential $Creds

对于凭据,请输入远程计算机上存在的用户名和密码。

远程主机上的防火墙还需要配置为允许来自本地主机的入站 Windows 远程管理框架流量。

关于powershell - 如何在本地计算机上使用 PowerShell invoke-command 远程运行的 Minecraft 服务器中输入命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55767354/

相关文章:

linux - 如何在本地环境之外的远程以 kiosk 模式运行 Ubuntu 系统

java - 立方体 3D 点旋转 X 和 Z

powershell - 比较三个数组并获取仅在array1中的值

powershell - 如何从 PowerShell 获取换行符中的字节数?

ubuntu - 使用 Sublime Text 编辑我用 vagrant 创建的本地服务器上的文件的解决方案?

java - 如何创建控制电脑鼠标的android应用程序

regex - Powershell:匹配运算符返回 true 但 $matches 为 null

powershell - XmlSerializer在PowerShell中的功能?

java - 如何获取列表的多个页面?

java - 取消伤害动画