Remote shell error

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.
Post Reply
User avatar
Abhishek_Paul
Posts: 19
Joined: Thu Apr 27, 2017 7:51 am

Remote shell error

Post by Abhishek_Paul » Tue Oct 10, 2017 12:23 pm

I have enabled PS remoting on the target Machine.
I am using the below command to test PS-Remoting:

Code: Select all

PS H:\Desktop> Test-WSMan xxxxxxxx


wsmid           : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd
ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor   : Microsoft Corporation
ProductVersion  : OS: 0.0.0 SP: 0.0 Stack: 2.0
It confirms that PS remoting is enabled on the remote system.However when I am entering the remote-PS Session, I am getting the below error:

Code: Select all

PS H:\Desktop> New-PSSession -ComputerName xxxxx  -Credential domain\username
New-PSSession : [xxxxxx] Connecting to remote server xxxxx failed with the following error message : The WS-Management service cannot process 
the request. The service is configured to not accept any remote shell requests. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ComputerName xxxxxx-Credential domain\user
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : RemoteSessionDisallowed,PSSessionOpenFailed
As the error code says "The service is configured to not accept any remote shell requests."

This could be due to hardening of policies or something else.

My Question is what could be the actual reason and what is the workaround for this ?

User avatar
jvierra
Posts: 11361
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Remote shell error

Post by jvierra » Tue Oct 10, 2017 12:36 pm

See the following article fro complete instructions on how to enable remoting fully.

https://support.microsoft.com/en-us/help/555966

The reason is that you have not correctly enabled remoting. There is no work around you must enable remoting correctly for your system and network type. THe support article will address some of these issues.

User avatar
Abhishek_Paul
Posts: 19
Joined: Thu Apr 27, 2017 7:51 am

Re: Remote shell error

Post by Abhishek_Paul » Wed Oct 11, 2017 11:42 am

As per your suggetion I run the below command :

Code: Select all

WinRM quickconfig -force
However, I am still getting the same error.
Test-WSMan command is confirming that PS remoting is successfully enabled and required services are running.

I have also tried to

Code: Select all

Set-ExecutionPolicy Bypass 
, also tried Unrestricted on the remote machine.
But, no success. Please help.

User avatar
jvierra
Posts: 11361
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Remote shell error

Post by jvierra » Wed Oct 11, 2017 12:06 pm

You need to follow all of the instructions. I see no way to help you as I do not have access to your systems and cannot gues at the remaining issue.

This forum is for scripting questions and not really scoped to help troubleshoot deployment issues. If you are not able to understand how to troubleshoot technical networking issues then I recommend either hiring a consultant or contacting Microsoft support.

Remember that you must determine whether this is a domain machine or a workgroup machine in order to know how to configure the endpoint systems.

You will also have issues when configuring PS 2 systems with PS 3 or later systems.

User avatar
Olga_B
Site Admin
Posts: 18
Joined: Mon May 15, 2017 9:06 am

Re: Remote shell error

Post by Olga_B » Wed Oct 11, 2017 5:59 pm

What Remote option are you using:
1. Run Remotely
2. Run Remotely RSEE

for 1. check if username/password are correct, also try to use client IP instead of name
for 2. Have you install RSEE service on client machine? Also double check client machine name

User avatar
jvierra
Posts: 11361
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Remote shell error

Post by jvierra » Wed Oct 11, 2017 6:46 pm

Olga. The New-PsSession command does not require or use RSEE. That is only used with PowerShell Studio remoting.

The issue is still that the WsRM/WsMan configuration is not set up correctly for the connection. The exception is "Open" failure. A credential failure would be "Access Denied". Test-WsMan Will only tell us that the service is running and listening.
This says that the remote is old:
ProductVersion : OS: 0.0.0 SP: 0.0 Stack: 2.0

Current versions return this: OS: 0.0.0 SP: 0.0 Stack: 3.0

Upgrading the client Power Shell version to 5.1 might fix this.

Post Reply