mithun_daa
mithun_daa

Reputation: 4384

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? 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.

Is this even possible?

Thanks.

Upvotes: 3

Views: 5070

Answers (1)

ravikanth
ravikanth

Reputation: 25810

Enter-PSSession inside another interactive session is not supported. Instead, try Invoke-Command to run commands on a remote computer while being in an interactive session.

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

Upvotes: 4

Related Questions