5

I setup the remote PowerShell access on the remote computer with the commands below:

Enable-PSRemoting -Force
Set-Item wsman:\localhost\Client\TrustedHosts -value '*' -Force
Get-Item wsman:\localhost\Client\TrustedHosts

   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Client

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   TrustedHosts                   GPO             *

They seemed to work just fine.

However, when trying to open a PowerShell session, I'm getting the error below:

New-PSSession -ComputerName 10.155.40.10
New-PSSession : [10.155.40.10] Connecting to remote server 10.155.40.10 failed with the following error message : The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ComputerName 10.155.40.10
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OpenError: (System.Management.A\u2026tion.RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : ServerNotTrusted,PSSessionOpenFailed

However, both pinging and accessing to the remote computer with RDP works:

Test-Connection 10.155.40.10
Pinging 10.155.40.10 [10.155.40.10] with 32 bytes of data:
Reply from 10.155.40.10: bytes=32 time=4ms TTL=125
Reply from 10.155.40.10: bytes=32 time=4ms TTL=125
Reply from 10.155.40.10: bytes=32 time=4ms TTL=125
Reply from 10.155.40.10: bytes=32 time=4ms TTL=125
Ping complete.

Source    Destination  Replies
------    -----------  -------
XXXXXXX   10.155.40.10 {System.Net.NetworkInformation.PingReply, System.Net.NetworkInformation.PingReply, System.Net.NetworkInformation.PingReply, System.Net.NetworkInformation.PingReply}

Any idea why I can't still open a PowerShell session?

1 Answer 1

4

Ping and RDP have nothing to do with PowerShell Remoting.

You are not saying whether these targets are domain joined (single forest/multi-forest, etc.) or workgroup. In a domain, you should only need to use GPO to Enable PSRemoting, with no need for the trusted host stuff, unless you are dealing with untrusted domains.

Workgroup PowerShell Remoting requires more set up the target and the source. It is well documented all over the web regarding many use case levels.

Saved pointers from my library of stuff...

Tip: Work Remotely with Windows PowerShell without using Remoting or WinRM

# On the remote computer 
# "Run as administrator" option

# Network adapters cannot be set to public, they must be set to private
((Get-NetConnectionProfile).InterfaceAlias)[1] | 
Set-NetConnectionProfile -InterfaceAlias $PSItem -NetworkCategory Private

<#
Or change this in the registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles
#>

# Set WSMan
Set-WSManQuickConfig 

# Enable Remoting
Enable-PSRemoting -SkipNetworkProfileCheck -Force

# Set the firewall
Set-NetFirewallRule –Name "WINRM-HTTP-In-TCP-PUBLIC" –RemoteAddress Any


# On the local computer
winrm set winrm/config/client @{TrustedHosts="10.0.2.33"}
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "10.0.2.33" -Force
Get-Item WSMan:\localhost\Client\TrustedHosts

Enable PowerShell Remoting on a standalone (workgroup) computer

PowerShell remoting between two workgroup machines

POWERSHELL PS REMOTING BETWEEN STANDALONE WORKGROUP COMPUTERS

PowerShell remoting between two workgroup machines

Enabling remote Powershell on workgroup computers

How to setup WinRM in a WorkGroup Non-Domain Environment

Understanding and troubleshooting WinRM connection and authentication: a thrill seeker's guide to adventure

WinRM (Windows Remote Management) Troubleshooting Tips

Troubleshoot WinRM with PowerShell—Part 1

Troubleshoot WinRM with PowerShell—Part 2

Learn How to Easily Troubleshoot PowerShell Remoting

About Remote Troubleshooting

PowerShell Remoting without administrator rights

PowerShell Remoting via WinRM for Non-Admin Users

Configuring WinRM over HTTPS to enable PowerShell remoting

Enabling Multihop Remoting

Enable PowerShell Double-Hop Remoting

Resolve Double-Hop Issue in PowerShell Remoting

PowerShell Remoting Kerberos Double Hop Solved Securely

What port does PowerShell remoting use?

Windows PowerShell: Implicit Remoting

Windows PowerShell: Dive Deep into Remoting

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .