Hello,
Hi im trying out powershell and really enjoying it, however i ran into a problem about remoting. I have a Windows Server 2012 R2(SRV1 and SRV2 - Core) and a Windows 8.1 (WKS1).
Im trying to do a remote management from WKS1 to SRV1 however when I issue the command"Invoke-Command -ComputerName srv1 -ScriptBlock { Get-EventLog -LogName Security | select LogName, Message -Last 3 }" - without the quotes, i get the error message. I cant event issue the Enter-PSsession -ComputerName srv1. I get these messages when I issue those commands.
(pre)PS C:\Windows\system32> Invoke-Command -ComputerName srv1 -ScriptBlock { Get-EventLog -LogName Security | select TimeWritten, Name }
[srv1] Connecting to remote server srv1 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.
+ CategoryInfo : OpenError: (srv1:String) , PSRemotingTransportException
+ FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken
PS C:\Windows\system32> Enter-PSSession -ComputerName srv1
Enter-PSSession : Connecting to remote server srv1 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 srv1
-
+ CategoryInfo : InvalidArgument: (srv1:String) [Enter-PSSession], PSRemotingTransportException + FullyQualifiedErrorId : CreateRemoteRunspaceFailed(/pre)
I already made changes to the firewall for
COM+ Network Access (DCOM-In) - Inbound rule to allow DCOM traffic for COM+ Network Access. [TCP 135]
Remote Event Log Management (RPC-EPMAP) - Inbound rule for the RPCSS service to allow RPC/TCP traffic for the local Event Log Service.
Remote Event Log Management (NP-In) - Inbound rule for the local Event Log service to be remotely managed over Named Pipes.
Remote Event Log Management (RPC) - Inbound rule for the local Event Log service to be remotely managed via RPC/TCP.
These are the ports that server manager use so i’m assuming that those are the ports that powershell remoting use, or am I wrong?
I do however able to powershell remote from srv1 to srv2.
I’m looking for a solution that I can deploy from GPO so that I wont have to go to every server workstation in my test virtual environment.
Any Ideas?