简体   繁体   English

我可以从远程会话启动远程PowerShell会话吗?

[英]Can I start a remote powershell session from a remote session?

I am able to successfully remote into one of the machines ( ComputerA ) in our enterprise at work using the following command Enter-PSSession Now can i start a new Enter-PSSession within this session to ComputerB ? 我能够使用以下命令成功远程访问我们企业中的一台计算机( ComputerAEnter-PSSession现在我可以在此会话中启动一个新的Enter-PSSessionComputerB吗? I am not able to do it. 我无法做到。 I get the following error: 我收到以下错误:

Remote host method PushRunspace is not implemented.
    + CategoryInfo          :
    + FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemotingDataStructureException,Microsoft.PowerSh
   ell.Commands.EnterPSSessionCommand

I am able to start a session from a powershell prompt on ComputerA to ComputerB . 我可以从ComputerA上的PowerShell提示启动会话到ComputerB

Is this even possible? 这甚至可能吗?

Thanks. 谢谢。

Enter-PSSession inside another interactive session is not supported. 不支持在另一个交互式会话中Enter-PSSession Instead, try Invoke-Command to run commands on a remote computer while being in an interactive session. 相反,尝试使用Invoke-Command在交互式会话中在远程计算机上运行命令。

PS C:\> Enter-PSSession -ComputerName Server-02
[Server-02]: PS C:\> Invoke-Command -ComputerName Server-03 -ScriptBlock { GCI C:\ } -Credential (Get-Credential)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM