Facing error in Powershell Remote Session

Hi All,

I need to execute powershell on servers behind firewall, i set server to use 8530 port (which we opened for patching) so i can reach DMZ server from Non-DMZ via 8530.

Below commands Configured on DMZ Server

Set-Item WSMan:\localhost\Service\EnableCompatibilityHttpListener -Value true

Set-Item wsman:\localhost\listener\listener*\port –value 8530

set-item wsman:\localhost\Client\TrustedHosts -value (non-dmz desktop from where i plan to run Powershell script)

While executing the below command

New-PSSession -ComputerName " IP" -Port 8530 -credential $cred

i am getting following error

Connecting to remote server failed with the following error message : The WinRM client cannot process th

e request. Default authentication may be used with an IP address under the following conditions: the transport is HTTPS

or the destination is in the TrustedHosts list, and explicit credentials are provided. Use winrm.cmd to configure Trus

tedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more information on how to set T

rustedHosts run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting He

lp topic.

  • CategoryInfo : OpenError: (System.Manageme…RemoteRunspace:RemoteRunspace) , PSRemotingTransportExc

eption

  • FullyQualifiedErrorId : PSSessionOpenFailed

If i execute with NAME

Invoke-Command -ComputerName HAMWINWIZP015 -ScriptBlock {Get-Process} -Credential $cred

Connecting to remote server failed with the following error message : WinRM cannot process the request.

The following error occured while using Kerberos authentication: The network path was not found.

Possible causes are:

-The user name or password specified are invalid.

-Kerberos is used when no authentication method and no user name are specified.

-Kerberos accepts domain user names, but not local user names.

-The Service Principal Name (SPN) for the remote computer name and port does not exist.

-The client and remote computers are in different domains and there is no trust between the two domains.

After checking for the above issues, try the following:

-Check the Event Viewer for events related to authentication.

-Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or us

e HTTPS transport.

Note that computers in the TrustedHosts list might not be authenticated.

-For more information about WinRM configuration, run the following command: winrm help config. For more information,

see the about_Remote_Troubleshooting Help topic.

  • CategoryInfo : OpenError: (:slight_smile: , PSRemotingTransportException

  • FullyQualifiedErrorId : PSSessionStateBroken

Could you suggest what would be the issue & if possible please help me to use that DMZ Server as proxy server as i am willing to run powershell on few DMZ Server via the one server.

From what I’m reading, TrustedHosts is your issue. Hopefully this will provide some pointers for you.

http://technet.microsoft.com/en-us/magazine/ff700227.aspx