Hi,
Thank you for posting in Microsoft Support Community.
Please add your computer to the WinRM TrustedHosts on both ends. Open Windows PowerShell and run
Set-Item WSMan:\localhost\Client\TrustedHosts -Value 'YourComputerName'
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
All,
I have a Server that suddenly in the last few days isn't accepting PowerShell Sessions or Exchange Management Shell Sessions. This is the error from the PS console:
Normal PowerShell:
Enter-PSSession
cmdlet Enter-PSSession at command pipeline position 1
Supply values for the following parameters:
ComputerName: server.domain.com
Enter-PSSession : Connecting to remote server server.domain.com failed with the following error message
: The client cannot connect to the destination specified in the request. Verify that the service on the destination is
running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ CategoryInfo : InvalidArgument: (server.domain.com:String) [Enter-PSSession], PSRemoting
TransportException
+ **FullyQualifiedErrorId : CreateRemoteRunspaceFailed**
When launching Exchange Management Shell:
The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ **FullyQualifiedErrorId : CannotConnect,PSSessionOpenFailed**
What I've checked / attempted so far:
Windows Firewall is disabled
WinRM Service is set to Automatic startup and is running
Successfully run WinRM QuickConfig
Ran Enable-PSRemoting
Note: There is always a corresponding Error Event ID 142 in the Windows Remote Management | Operational Log with the error: WSMan operation CreateShell failed, error code 2150858770
Other commands and output tested:
Test-WSMan
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: 3.0
winrm get winrm/config
Config ****
MaxEnvelopeSizekb = 500
MaxTimeoutms = 60000
MaxBatchItems = 32000
MaxProviderRequests = 4294967295
Client
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = false
Auth Basic = true
Digest = true
Kerberos = true
Negotiate = true
Certificate = true
CredSSP = false
DefaultPorts
HTTP = 5985
HTTPS = 5986
TrustedHosts
Service
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
MaxConcurrentOperations = 4294967295
MaxConcurrentOperationsPerUser = 1500
EnumerationTimeoutms = 240000
MaxConnections = 300
MaxPacketRetrievalTimeSeconds = 120
AllowUnencrypted = false
Auth
Basic = false
Kerberos = true
Negotiate = true
Certificate = false
CredSSP = false
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986
IPv4Filter = *
IPv6Filter = *
EnableCompatibilityHttpListener = false
EnableCompatibilityHttpsListener = false
CertificateThumbprint
AllowRemoteAccess = true
Winrs
AllowRemoteShellAccess = true
IdleTimeout = 7200000
MaxConcurrentUsers = 2147483647
MaxShellRunTime = 2147483647
MaxProcessesPerShell = 2147483647
MaxMemoryPerShellMB = 2147483647
MaxShellsPerUser = 2147483647
Get-WSManInstance winrm/config/listener -Enumerate
cfg : http://schemas.microsoft.com/wbem/wsman/1/config/listener
xsi : http://www.w3.org/2001/XMLSchema-instance
lang : en-US
Address : *
Transport : HTTP
Port : 5985
Hostname :
Enabled : true
URLPrefix : wsman
CertificateThumbprint : ListeningOn : {10.0.0.5, 127.0.0.1, ::1, fe80::5efe:10.0.0.5%3...}
I haven't found a way to fix this yet. Any suggestions?
Thanks.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.
Hi,
Thank you for posting in Microsoft Support Community.
Please add your computer to the WinRM TrustedHosts on both ends. Open Windows PowerShell and run
Set-Item WSMan:\localhost\Client\TrustedHosts -Value 'YourComputerName'
Thanks for the tip.
Issuing simply "New-PSSession" will create a session however if I attempt: "New-PSSession -ComputerName server.domain.com" I still get the error:
New-PSSession : [server.domain.com] Connecting to remote server server.domain.com failed
with the following error message : The client cannot connect to the destination specified in the request. Verify that
the service on the destination is running and is accepting requests. Consult the logs and documentation for the
WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service,
run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more
information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException
+ FullyQualifiedErrorId : CannotConnect,PSSessionOpenFailed
I'm still seeing this in The Windows Remote Management Log frequently:
Event ID: 142
WSMan operation CreateShell failed, error code 2150858770
What does this mean?
The error code 2150858770 just means "The client cannot connect to the destination specified in the request."
This is really odd as I'm doing all of this on the local system.
I added the trusted hosts value but I'm still getting an error: "CannotConnect, PSSessionOpenFailed"