Remote shell error

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
Abhishek_Paul
Posts: 24
Last visit: Fri Jun 15, 2018 2:04 am

Remote shell error

Post by Abhishek_Paul »

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 ?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Remote shell error

Post by jvierra »

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: 24
Last visit: Fri Jun 15, 2018 2:04 am

Re: Remote shell error

Post by Abhishek_Paul »

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.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Remote shell error

Post by jvierra »

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: 196
Last visit: Mon Mar 25, 2024 11:57 am

Re: Remote shell error

Post by Olga_B »

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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Remote shell error

Post by jvierra »

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.
This topic is 6 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked