# Enter-PSSession Error for my own vm

**URL:** <https://forums.powershell.org/t/enter-pssession-error-for-my-own-vm/3384>\
**Category:** PowerShell Help\
**Created:** [November 6, 2014, 6:33am UTC](https://forums.powershell.org/t/enter-pssession-error-for-my-own-vm/3384 "2014-11-06T06:33:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ritwik-chatterjee](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@ritwik-chatterjee](https://forums.powershell.org/u/ritwik-chatterjee)\
**Post date:** [November 6, 2014, 6:33am UTC](https://forums.powershell.org/t/enter-pssession-error-for-my-own-vm/3384/1 "2014-11-06T06:33:46Z")

</div>

Hi,

I am new to powershell and new to the forum.

I am trying to remote into one vm from another vm and I am getting the following error:

[i]Enter-PSSession : Connecting to remote server ritwikdevbox4 failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about\_Remote\_Troubleshooting Help topic.  
At line:1 char:1

- Enter-PSSession -ComputerName ritwikdevbox4
- 

```auto
  + CategoryInfo : InvalidArgument: [ritwikdevbox4:String] [Enter-PSSession], PSRemotingTransportException
  + FullyQualifiedErrorId : CreateRemoteRunspaceFailed[/i]

```

Here are the steps I have taken prior to this:

1. Setup a new vm on Azure with a Windows Server 2012 R2 image called ritwikdevbox2
2. Setup a second vm on Azure with a Windows Server 2012 R2 image called ritwikdevbox4. It is in the same domain as ritwikdevbox2

Here are the nslookup output on ritwikdevbox2 prompt:

PS [ritwikdevbox2] \> nslookup ritwikdevbox2  
[i]Server: UnKnown  
Address: 168.63.129.16

Name: [ritwikdevbox2.ritwikdevbox2.d2.internal.cloudapp.net](http://ritwikdevbox2.ritwikdevbox2.d2.internal.cloudapp.net)  
Address: 1xx.16.0.4[/i]

PS [ritwikdevbox2] \> nslookup ritwikdevbox4  
[i]Server: UnKnown  
Address: 168.63.129.16

Non-authoritative answer:  
Name: [ritwikdevbox4.ritwikdevbox2.d2.internal.cloudapp.net](http://ritwikdevbox4.ritwikdevbox2.d2.internal.cloudapp.net)  
Address: 1xx.16.0.6[/i]

1. Ran Enter-PSSession from ritwikdevbox2

PS [ritwikdevbox2] \> Enter-PSSession -ComputerName ritwikdevbox4

Error received  
[i]Enter-PSSession : Connecting to remote server ritwikdevbox4 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

- Enter-PSSession -ComputerName ritwikdevbox4
- 

```auto
  + CategoryInfo : InvalidArgument: [ritwikdevbox4:String] [Enter-PSSession], PSRemotingTransportException
  + FullyQualifiedErrorId : CreateRemoteRunspaceFailed[/i]

```

Issue fixed by:  
PS [ritwikdevbox2] \> Set-Item wsman:localhost\client\trustedhosts -Value ritwikdevbox4

Again trying Enter-PSSession  
PS C:\Users\ritwikadmin\> Enter-PSSession -ComputerName ritwikdevbox4

Here is the error I receive:

[i]Enter-PSSession : Connecting to remote server ritwikdevbox4 failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about\_Remote\_Troubleshooting Help topic.  
At line:1 char:1

- Enter-PSSession -ComputerName ritwikdevbox4
- 

```auto
  + CategoryInfo : InvalidArgument: [ritwikdevbox4:String] [Enter-PSSession], PSRemotingTransportException
  + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

```

[/i]

I realize that I probably am making a very silly mistake. I probably need to open up a port or something of that sort. But I have spent more than a few hours trying to move beyond this and I cannot. Please help.

Please help. Please do not assume anything. I am new to windows technology. So I might be missing the smallest bit of things.

Thanks in advance.

Ritwik

---

<div class="post-metadata">

**Author:** ![ondrej-zilinec](https://avatars.discourse-cdn.com/v4/letter/o/e480ec/32.png) [@ondrej-zilinec](https://forums.powershell.org/u/ondrej-zilinec)\
**Post date:** [November 6, 2014, 6:48am UTC](https://forums.powershell.org/t/enter-pssession-error-for-my-own-vm/3384/2 "2014-11-06T06:48:09Z")

</div>

Look how it’s [set in domain](http://www.cievo.sk/2014/03/21/remote-powershell-in-domain-environment/), maybe you fill get idea how to setup in your environment.

---

<div class="post-metadata">

**Author:** ![steinpetersen](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/steinpetersen/32/303_2.png) [@steinpetersen](https://forums.powershell.org/u/steinpetersen)\
**Post date:** [November 6, 2014, 8:00am UTC](https://forums.powershell.org/t/enter-pssession-error-for-my-own-vm/3384/3 "2014-11-06T08:00:42Z")

</div>

Can you run

```
Get-NetConnectionProfile
```
 on ritwikdevbox4.

If it responds with public, set it to private or domain if you can, and try connecting to it again.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:46pm UTC](https://forums.powershell.org/t/enter-pssession-error-for-my-own-vm/3384/4 "2024-05-16T20:46:47Z")

</div>

Closed on May 16, 2024, 8:46pm UTC


