powershell remoting

rated by 0 users
This post has 10 Replies | 1 Follower

Top 200 Contributor
Posts 15
kelster101757 Posted: 06-02-2011 2:21 AM

I've enabled PowerShell remoting via Group Policy (starting the WinRM service and opening up ports 5985 ) and it works on our windows 7 clients but i cant connect to our Windows XP clients. This is the error below from a example workstation:


Enter-PSSession : Connecting to remote server failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRMservice, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:16
+ Enter-PSSession <<<<  xp-tbh-vm-esxi.tbh.local
    + CategoryInfo          : InvalidArgument: (xp-tbh-vm-esxi.tbh.local:String) [Enter-PSSession], PSRemotingTranspor   tException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

 

Both windows XP and windows 7 clients show WinRM as started and show port 5985 as open. Powershell2 is installed on the XP clients.

 

 

Thanks

Top 10 Contributor
Posts 634
Microsoft MVP
Top Contributor

Are both target machines joined to a domain?

To check whether GPO settings are the problem, try and enable PS Remoting on the XP machine manually:

Enable-PSRemoting

Check if that enables remote access. If so, we need to investigate the GPO procedure. If not, we know the GPO procedure is not the problem.

Top 200 Contributor
Posts 15

Both machines are joined to the same domain.  Heres the series of events ive just tried:

--- From the server i ran test-connect "clientA" and received replys

--- Enter-PSSession Clienta

Enter-PSSession : Connecting to remote server failed with the following error message : The WinRM client cannot complete the operation within the time specified. Check if the machine name is valid and is reachable over the network and firewall exception for Windows Remote Management service is enabled. For more information, see the about_Remote_Troubleshooting Help topic.

At line:1 char:16

+ Enter-PSSession <<<<  clienta

    + CategoryInfo          : InvalidArgument: (clienta:String) [Enter-PSSession], PSRemotingTransportException

    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

----  I remote desktop'd to the client and ran Enable-PSRemoting:

WinRM Quick Configuration

Running command "Set-WSManQuickConfig" to enable this machine for remote management through WinRM service.

 This includes:

    1. Starting or restarting (if already started) the WinRM service

    2. Setting the WinRM service type to auto start

    3. Creating a listener to accept requests on any IP address

    4. Enabling firewall exception for WS-Management traffic (for http only).

 

Do you want to continue?

Yes Yes  Angel Yes to All  No No  [L] No to All  Sleep Suspend  [?] Help (default is "Y"): a

WinRM already is set up to receive requests on this machine.

WinRM has been updated for remote management.

WinRM firewall exception enabled.

 

---- i then ran "Enter-PSSession Clienta" and connected fine.  

 

Any ideas on the cause? 

 

Top 10 Contributor
Posts 634
Microsoft MVP
Top Contributor

Are you certain you installed the latest PS V2 on XP? Just to make sure we don't have a WSMAN compat issue.

Can you share the results from:

$psversiontable

 

Top 200 Contributor
Posts 15

Just to point out ( i'm not sure whether i'm made it clear in my last post) that after i ran enable-psremote, i could "enter-pssession" in from our server to "client a" so everyone worked fine.  However, i dont want to work around to each machine and running the "enable-pssesion". i want to run a group policy to make it easier for me.  Anyway, i'm sure you knew where i was going with the post so heres the information you asked for, thanks again:

 

Name                           Value

----                           -----

CLRVersion                     2.0.50727.3620

BuildVersion                   6.0.6002.18111

PSVersion                      2.0

WSManStackVersion              2.0

PSCompatibleVersions           {1.0, 2.0}

SerializationVersion           1.1.0.1

PSRemotingProtocolVersion      2.1

Top 10 Contributor
Posts 634
Microsoft MVP
Top Contributor

No, in fact I overlooked that one ;-)

So when enabling manually works, we need to look at what you did with GPO. Here is an excellent write-up. Please double-check that you did all the steps outlined there. Please let me know if you found the step you may have missed!

http://blog.crayon.no/blogs/janegil/archive/2010/03/04/enable_2D00_and_2D00_configure_2D00_windows_2D00_powershell_2D00_remoting_2D00_using_2D00_group_2D00_policy.aspx

Top 10 Contributor
Posts 634
Microsoft MVP
Top Contributor

Actually, by reading that post again, I found the answer :-) You can use GPO only for Vista and above. It will not work for XP. So on XP, it recommends using a startup script running Enable-PSRemoting.

Top 200 Contributor
Posts 15

yeah, i actually just found that this morning.  problem solved.  Thanks a lot for all your help :-) 

Top 200 Contributor
Posts 15

for anybody else reading the group policy for xp is :  Navigate to Computer Configuration\Administrative Templates\Network\Network Connections\Windows Firewall.

 

 

Top 10 Contributor
Posts 634
Microsoft MVP
Top Contributor

So can you fully automate deployment for XP after all? Do you have time to do a quick step-by-step to help all of us? Thx!

Top 200 Contributor
Posts 15

yeah sure.  I'll get some wrote up 

Page 1 of 1 (11 items) | RSS
Copyright 2012 PowerShell.com. All rights reserved.