# Unable to do PowerShell remoting - plz guide.

**URL:** <https://forums.powershell.org/t/unable-to-do-powershell-remoting-plz-guide/12128>\
**Category:** PowerShell Help\
**Created:** [March 5, 2019, 9:45am UTC](https://forums.powershell.org/t/unable-to-do-powershell-remoting-plz-guide/12128 "2019-03-05T09:45:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![j2sankha](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@j2sankha](https://forums.powershell.org/u/j2sankha)\
**Post date:** [March 5, 2019, 9:45am UTC](https://forums.powershell.org/t/unable-to-do-powershell-remoting-plz-guide/12128/1 "2019-03-05T09:45:55Z")

</div>

Hello Team,

As per my thread title, I am unable to remote a 2016 DC. Following is the scenario;

My current forest structure is like _site1.childdomain.parentdomain.com_.

I am remoting through parentdomain.com. **There is not trust between them**. Its different entity, for testing purpose only.

So I added _\*.childdomain.parentdomain.com_ in trustedhost list. And then I was able to remote a _site1.childdomain.parentdomain.com_ DC using its specif credential.

But I am unable to remote at _site2.childdomain.parentdomain.com_ dcs.

I checked, IPv6 was Disable, Firewall was disabled, WSman running, its server 2016, yet I executed enable-psremoting, winrm qc. But no luck.

**Following is the error when I use ICM {gps} -cn _DC02.site2.childdomain.parentdomain.com_.**

[pre]Connecting to remote server _DC02.site2.childdomain.parentdomain.com_ failed with the following error message : A specified

logon session does not exist. It may already have been terminated. For more information, see the about\_Remote\_Troubleshooting Help topic.

+ CategoryInfo : OpenError: (_DC02.site2.childdomain.parentdomain.com_:String) [], PSRemotingTransportException

+ FullyQualifiedErrorId : 1312,PSSessionStateBroken

[/pre]

**Following is the output of Test-wsman -cn _DC02.site2.childdomain.parentdomain.com_ -Authentication Negotiate -Credential $cred** 

[pre]Test-WSMan : \<f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="5" Machine="mypc.parentdomain.com"\>\<f:Message\>Access

is denied. \</f:Message\>\</f:WSManFault\>

At line:1 char:1

+ Test-WSMan -cn "_DC02.site2.childdomain.parentdomain.com_" -Authentication Negotiate - ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidOperation: (_DC02.site2.childdomain.parentdomain.com_:String) [Test-WSMan], InvalidOperationException

+ FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand

[/pre]

Finally, I did mstsc to the _DC02. **site1**.childdomain.parentdomain.com_, and use enter-pssession _DC02. **site2**.childdomain.parentdomain.com_. Now it worked.

I got frustrated. What is the issue then? Is any thing wrong with trusted host? I am suspecting this one, but as per logic it shouldn't be the issue.

Could anyone point me out.

Thank you.

Roy.

---

<div class="post-metadata">

**Author:** ![j2sankha](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@j2sankha](https://forums.powershell.org/u/j2sankha)\
**Post date:** [March 5, 2019, 9:50am UTC](https://forums.powershell.org/t/unable-to-do-powershell-remoting-plz-guide/12128/2 "2019-03-05T09:50:55Z")

</div>

I m sorry team, did some formatting / tag mistake. Its looks bit wired for error messages. Only single line placed under pre tag. I m really sorry.

---

<div class="post-metadata">

**Author:** ![rob-simmers](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/rob-simmers/32/1010_2.png) [@rob-simmers](https://forums.powershell.org/u/rob-simmers)\
**Post date:** [March 5, 2019, 9:54am UTC](https://forums.powershell.org/t/unable-to-do-powershell-remoting-plz-guide/12128/3 "2019-03-05T09:54:22Z")

</div>

Have you looked at [Secrets of PowerShell Remoting](https://leanpub.com/secretsofpowershellremoting)?

---

<div class="post-metadata">

**Author:** ![j2sankha](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@j2sankha](https://forums.powershell.org/u/j2sankha)\
**Post date:** [March 5, 2019, 12:49pm UTC](https://forums.powershell.org/t/unable-to-do-powershell-remoting-plz-guide/12128/4 "2019-03-05T12:49:54Z")

</div>

[quote quote=142911]Have you looked at [Secrets of PowerShell Remoting](https://leanpub.com/secretsofpowershellremoting)?

[/quote]  
Thanks for the reference, I ll definitely read that. For now could you plz suggest me where should I check without referring entire book.

---

<div class="post-metadata">

**Author:** ![postanote](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@postanote](https://forums.powershell.org/u/postanote)\
**Post date:** [March 5, 2019, 4:11pm UTC](https://forums.powershell.org/t/unable-to-do-powershell-remoting-plz-guide/12128/5 "2019-03-05T16:11:37Z")

</div>

This is an environmental thing on your side, and since we are not in your environment, we’d be guessing.

There are many things that can cause Access Denied. This is not specific to PS.

How do you enable PSRemoting, on the destination?  
What account are you trying to use for this remoting session?  
What exactly are you trying to do? (many cmdlets / actions require you be a local admin on the target.)

Adding something to trusted host is a PSRemoting workgroup confit, not domain. Even so there are settings, when in workgroup mode the you must set for it to work.

In a domain model, there should be little reason to do this. Which means you have a misunderstanding about what PSRemoting should work. Thus the suggestion of reading the eBook, or one like it is prudent so that can approach this as defined.

Windows authentication boundaries will prevent removing as well as the dreaded double hop Auth issues.

Resolve Double-Hop Issue in PowerShell Remoting  
[https://www.codeproject.com/Tips/847119/Resolve-Double-Hop-Issue-in-PowerShell-Remoting](https://www.codeproject.com/Tips/847119/Resolve-Double-Hop-Issue-in-PowerShell-Remoting)

Enabling Multihop Remoting

> **[Enabling Multihop Remoting](https://devblogs.microsoft.com/scripting/enabling-multihop-remoting/)**
>
> Summary: Microsoft PowerShell MVPs, Don Jones and Jeffery Hicks, discuss how to enable multihop remoting in Windows PowerShell 3.0. Microsoft Scripting Guy, Ed Wilson, is here. Tonight is our Windows PowerShell User Group meeting in Charlotte, NC, I...

Enable PowerShell Double-Hop Remoting

> **[Enable PowerShell Double-Hop Remoting](https://www.travisgan.com/2014/03/enable-powershell-double-hop-remoting.html)**
>
> Travis Gan's technical blog on Microsoft SQL Server, BI Stack (SSIS, SSRS, SSAS), Microsoft .NET and other technologies.

PowerShell Remoting Kerberos Double Hop Solved Securely

> **[PowerShell Remoting Kerberos Double Hop Solved Securely](https://docs.microsoft.com/en-us/archive/blogs/ashleymcglone/powershell-remoting-kerberos-double-hop-solved-securely)**

Windows firewalls or other security gateways between source and destination can choke out what thigs as well.

What port does PowerShell remoting use?

> **[What port does PowerShell remoting use?](https://docs.microsoft.com/en-us/archive/blogs/christwe/what-port-does-powershell-remoting-use)**

---

<div class="post-metadata">

**Author:** ![j2sankha](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@j2sankha](https://forums.powershell.org/u/j2sankha)\
**Post date:** [March 6, 2019, 1:29am UTC](https://forums.powershell.org/t/unable-to-do-powershell-remoting-plz-guide/12128/6 "2019-03-06T01:29:25Z")

</div>

[quote quote=143015]This is an environmental thing on your side, and since we are not in your environment, we’d be guessing.

There are many things that can cause Access Denied. This is not specific to PS.

How do you enable PSRemoting, on the destination?

What account are you trying to use for this remoting session?

What exactly are you trying to do? (many cmdlets / actions require you be a local admin on the target.)

Adding something to trusted host is a PSRemoting workgroup confit, not domain. Even so there are settings, when in workgroup mode the you must set for it to work.

In a domain model, there should be little reason to do this. Which means you have a misunderstanding about what PSRemoting should work. Thus the suggestion of reading the eBook, or one like it is prudent so that can approach this as defined.

Windows authentication boundaries will prevent removing as well as the dreaded double hop Auth issues.

Resolve Double-Hop Issue in PowerShell Remoting

[https://www.codeproject.com/Tips/847119/Resolve-Double-Hop-Issue-in-PowerShell-Remoting](https://www.codeproject.com/Tips/847119/Resolve-Double-Hop-Issue-in-PowerShell-Remoting)

Enabling Multihop Remoting

> [Enabling Multihop Remoting](https://devblogs.microsoft.com/scripting/enabling-multihop-remoting/)

\<iframe class="wp-embedded-content" title="" src="https://devblogs.microsoft.com/scripting/enabling-multihop-remoting/embed/#?secret=D9hCAnVaJe" width="600" height="649" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" sandbox="allow-scripts" data-secret="D9hCAnVaJe" data-mce-fragment="1"\>\</iframe\>

Enable PowerShell Double-Hop Remoting

[https://www.travisgan.com/2014/03/enable-powershell-double-hop-remoting.html](https://www.travisgan.com/2014/03/enable-powershell-double-hop-remoting.html)

PowerShell Remoting Kerberos Double Hop Solved Securely

[https://blogs.technet.microsoft.com/ashleymcglone/2016/08/30/powershell-remoting-kerberos-double-hop-solved-securely](https://blogs.technet.microsoft.com/ashleymcglone/2016/08/30/powershell-remoting-kerberos-double-hop-solved-securely)

Windows firewalls or other security gateways between source and destination can choke out what thigs as well.

What port does PowerShell remoting use?

[https://blogs.technet.microsoft.com/christwe/2012/06/20/what-port-does-powershell-remoting-use](https://blogs.technet.microsoft.com/christwe/2012/06/20/what-port-does-powershell-remoting-use)

[/quote]  
Thanks for detail guide. I know its a env issue. But for now I was unable to think where to start.

As I mentioned earlier, if I mstsc to site1 server and then do psremote to site2 server, its working. But when I m doing psremoting from parent domain using trusted host, where trust is not available, there I get the access denied issue.

If its account level issue it should block everytime. Thats why I m suspecting trusted host. I already start reading the book, I hope I’ll manage something. In the mean time, if you think I should check … areas, plz let me know.

In trusted host list I added \*.childdomain.parentdomain.com. Plz confirm me that should allow me to psremote all the servers under same namespace, Or I have to add each server.

Thanks again.

Roy.

---

<div class="post-metadata">

**Author:** ![postanote](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@postanote](https://forums.powershell.org/u/postanote)\
**Post date:** [March 6, 2019, 2:35pm UTC](https://forums.powershell.org/t/unable-to-do-powershell-remoting-plz-guide/12128/7 "2019-03-06T14:35:43Z")

</div>

**Don’t use mstsc as any indicator of relevance of what you are seeing / using in PowerShell. Both have their own port/protocol/Comms requirements.**

 

_mstsc (uses RDP) and PSRemoting (uses WinRM/WMI/DCOM/CIM) are two entirely different things._

 

_If you cannot to basic WMI / DCOM / CIM calls to that target, then you are being blocked by something, in upstream, or it’s a configuration issue on the target(s)._

 

_Secondly, don’t do this… \*.childdomain.parentdomain.com —  
Put the specific host name, into TrustedHosts. Configure the remote machine to have an HTTPS listener - the SSL certificate you’ll install will make the mutual authentication happen._

 

_See also:_

 

_> **[Remoting Week: Non-Domain Remoting](https://devblogs.microsoft.com/scripting/remoting-week-non-domain-remoting/)**
>
> Summary: Richard Siddaway explains how to use Windows PowerShell remoting to access machines that aren’t in your domain.  Hey, Scripting Guy! I’ve just starting learning Windows PowerShell, and I understand how to use it as a scripting language..._

---

<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:33pm UTC](https://forums.powershell.org/t/unable-to-do-powershell-remoting-plz-guide/12128/8 "2024-05-16T20:33:10Z")

</div>


