# Remote Control Domain Controller

**URL:** <https://forums.powershell.org/t/remote-control-domain-controller/6263>\
**Category:** PowerShell Help\
**Created:** [April 20, 2016, 1:04am UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263 "2016-04-20T01:04:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![aww31763](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@aww31763](https://forums.powershell.org/u/aww31763)\
**Post date:** [April 20, 2016, 1:04am UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/1 "2016-04-20T01:04:04Z")

</div>

I was watching an MVA (Microsoft Virtual Academy) video by Jason Helmick and Jeffery Snover on Powershell 3.0 it seemed like a good place to start and learn the fundamentals so I started following along with them through examples for Enter-PSSession to remotely control one of the Domain controllers. I started the Powershell IISE as an Administrator on my workstation the example failed with the following description.

PS C:\WINDOWS\system32\> Enter-PSSession -ComputerName co-5023  
Enter-PSSession : Connecting to remote server co-5023 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 co-5023
- 

```auto
  + CategoryInfo : InvalidArgument: (co-5023:String) [Enter-PSSession], PSRemotingTransportException
  + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

```

I checked the Get-Help about\_Remote\_Troubleshooting and followed the suggestions to isolate the problem without success.

I am brand new to Powershell and not afraid to read or listen when someone with experience offers a suggestion. I work for a small school district and we have a single Domain, I have multiple Domain controllers both physical and Virtual (running Hyper V) I was really intrigued with the option of automating several task through Powershell and disappointed when I was unable to use the tool properly.

any and all help appreciated.

---

<div class="post-metadata">

**Author:** ![silent-steel](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@silent-steel](https://forums.powershell.org/u/silent-steel)\
**Post date:** [April 20, 2016, 3:09am UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/2 "2016-04-20T03:09:15Z")

</div>

Read about how to configure and enable WinRM. IIRC on Domain Controllers its disabled and not configured for security reasons.

This is also assuming you don’t have windows firewall blocking as its a domain controller in which case further reading on network ports used by WinRM should point you in the necessary ports that you need to open.

> **[Enabling WinRM on Domain Controllers](https://regularsysadmin.wordpress.com/2015/08/02/enabling-winrm-on-domain-controllers/)**
>
> WinRM is a really cool feature when scripting tasks and managing Windows servers remotely. I’ve been struggling to enable it on the domain controllers in our globally-distributed environment,…

might help but not only.

---

<div class="post-metadata">

**Author:** ![aww31763](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@aww31763](https://forums.powershell.org/u/aww31763)\
**Post date:** [April 20, 2016, 3:27am UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/3 "2016-04-20T03:27:29Z")

</div>

HI Arie  
Domain Controller is a Windows Server 2012 r2 and I went through the about\_remote\_troubleshooting to include the get-service winRM to make sure it was running and also checked the advanced settings on the firewall. my admin workstation is running Windows 10 Pro and both the workstation and Domain Controller are running WMF 5.0  
I’m sure I am overlooking a simple setting or syntax to allow me to access the Domain controller. When Jason demonstrated how easy it was I was impressed. I should have remembered Murphy’s Law “when everything seems to be going fine you’ve obviously overlooked something”  
Thanks for the suggestion Arie, at least I know I’m not alone in the Powershell Universe 🙂

---

<div class="post-metadata">

**Author:** ![silent-steel](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@silent-steel](https://forums.powershell.org/u/silent-steel)\
**Post date:** [April 20, 2016, 6:42pm UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/4 "2016-04-20T18:42:35Z")

</div>

Hi Alan,

You’re not alone in the PowerShell Universe. Were all but Get-StarDust 🙂

Try running the Enter -PSSession from a different sever or station.  
Try from the domain controller itself.

I assume you run the PowerShell with admin rights and the your domain user has sufficient permission on the domain controller.  
I also assume you don’t have a group policy set to disable the necessary service.

If RM is configured correctly, you should be able to run something like this  
Get-Service -ComputerName DC1  
If this works, the RemoteManagement works even if PowerShell remoting doesn’t , in which case PowerShell remoting is the culprit.

---

<div class="post-metadata">

**Author:** ![rdtechie](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/rdtechie/32/273_2.png) [@rdtechie](https://forums.powershell.org/u/rdtechie)\
**Post date:** [April 21, 2016, 4:41am UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/5 "2016-04-21T04:41:48Z")

</div>

Normally this would work out of the box on W10 & W2012R2, if they are in the same domain and/or you use the proper permissions. PSRemoting is enabled by default.

Is name resolving working correctly for the target from your W10 computer?

What does Test-WSMan gives you when you run that on the target?

Try to troubleshoot with the help of: [https://www.penflip.com/powershellorg/secrets-of-powershell-remoting/blob/master/diagnostics-and-troubleshooting.txt](https://www.penflip.com/powershellorg/secrets-of-powershell-remoting/blob/master/diagnostics-and-troubleshooting.txt)

---

<div class="post-metadata">

**Author:** ![justin-king](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/justin-king/32/308_2.png) [@justin-king](https://forums.powershell.org/u/justin-king)\
**Post date:** [April 21, 2016, 5:09am UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/6 "2016-04-21T05:09:02Z")

</div>

To be clear, the winrm service running is NOT enough to ensure you can connect to the box. The service supports limiting source IPs and other tricks. quick and dirty way to get it working: “winrm quickconfig”, it will check the service, ensure permissions are defaulted, and open the firewall ports. Be aware this makes Winrm open to anyone in the domain with creds, which may or may not be a good thing.

---

<div class="post-metadata">

**Author:** ![aww31763](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@aww31763](https://forums.powershell.org/u/aww31763)\
**Post date:** [April 21, 2016, 7:00am UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/7 "2016-04-21T07:00:10Z")

</div>

Hi again Arie  
Looking at your note:  
all commands run from an elevated Administrator prompt ISE 64 bit  
we are a small school district and I personally created the Windows Server 2012r2 I am trying to connect to from my workstation.  
The server manager on my workstation allows me to initiate a Remote Desktop Session without any problems. I was really hoping to be able to learn enough to automate several of my daily task with a script.

I have tried to enter-Pssession from my workstation as well as several of the member servers and both of the Domain Controllers. each time it gives me the following information

PS C:\Windows\system32\>  
PS C:\Windows\system32\> Enter-PSSession

cmdlet Enter-PSSession at command pipeline position 1  
Supply values for the following parameters:  
ComputerName: co-aww-14  
Enter-PSSession : Connecting to remote server co-aww-14 fail  
the destination is running and is accepting requests. Consul  
the WinRM service, run the following command on the destinat  
At line:1 char:1

- Enter-PSSession
- 

```auto
  + CategoryInfo : InvalidArgument: (co-aww-14:St
  + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

```

I am certain there is an answer to the problem once I learn enough to ask the correct question.

patient and persistent  
Alan

---

<div class="post-metadata">

**Author:** ![aww31763](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@aww31763](https://forums.powershell.org/u/aww31763)\
**Post date:** [April 21, 2016, 7:47am UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/8 "2016-04-21T07:47:17Z")

</div>

Hi Richard and Justin  
testing both recommendations I got the following results

PS C:\Windows\system32\> test-wsman

wsmid : [http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd](http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd)  
ProtocolVersion : [http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd](http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd)  
ProductVendor : Microsoft Corporation  
ProductVersion : OS: 0.0.0 SP: 0.0 Stack: 3.0

PS C:\Windows\system32\> winrm quickconfig  
WinRM service is already running on this machine.  
WinRM is already set up for remote management on this computer.  
PS C:\Windows\system32\>

I am inside our domain (small school district, small domain) 🙂

Richard I will go through the article you referenced.

still patient and persistent and thanks to everyone  
Alan

---

<div class="post-metadata">

**Author:** ![aww31763](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@aww31763](https://forums.powershell.org/u/aww31763)\
**Post date:** [April 22, 2016, 6:50am UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/9 "2016-04-22T06:50:09Z")

</div>

Hello Aire, Richard and Justin  
Thanks for all the help and suggestions.  
Richard the article you referenced  
powershellorg · Secrets of PowerShell Remoting  
pointed me in the right direction and it was a blocked port or more to the point a missing checkmark on the firewall settings. With that part behind me I can continue following the tutorials shown in the Microsoft Virtual Academy and hopefully learn a little.

again my thanks to all of you  
Alan

---

<div class="post-metadata">

**Author:** ![rdtechie](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/rdtechie/32/273_2.png) [@rdtechie](https://forums.powershell.org/u/rdtechie)\
**Post date:** [April 23, 2016, 7:59am UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/10 "2016-04-23T07:59:22Z")

</div>

That’s great to hear Alan! Enjoy your PowerShell experience!

---

<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:41pm UTC](https://forums.powershell.org/t/remote-control-domain-controller/6263/11 "2024-05-16T20:41:30Z")

</div>


