none
Help with Remoting PowerShell ISE

    Question

  • I am a newbie to Scripting been reading Windows PowerShell 2.0 Best Practices
    Have the basic VBS map drives and copy folders down but the fun begins with powershell right!!!

    powershell ise fails to start on any xp sp3 machine i have so i built a vm of win7 on a completely different machine

    I have 2 win7 pc  1 desktop 1 VM enabled winrm on both made sure all are running firewall exceptions even tried turning it off.

    I run get-service -computername win7  This works great  get-process and ANY other command variant dose not it errors no matter which way i try to run it fails  errors are below..  Changed names and domains for privacy.

    Any help would be greatly appreciated.

    thanks in advance



    PS C:\Windows\system32> Get-Process -ComputerName win7
    Get-Process : Couldn't connect to remote machine.
    At line:1 char:12
    + Get-Process <<<<  -ComputerName win7
        + CategoryInfo          : NotSpecified: (:) [Get-Process], InvalidOperation
       Exception
        + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerS
       ____.Commands.GetProcessCommand


    _____________________________________________________________________________
    PS C:\Windows\system32> Invoke-Command -ComputerName win7 -ScriptBlock {Get-Process}
    [win7] 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 excepti
    on for Windows Remote Management service is enabled. For more information, see t
    he about_Remote_Troubleshooting Help topic.
        + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
        + FullyQualifiedErrorId : PSSessionStateBroken

    _____________________________________________________________________________


    PS C:\Windows\system32> Enter-PSSession 'win7' -Credential:'domain\username'
    if ($?) {$psISE.CurrentPowerShellTab.DisplayName = 'win7'}
    Enter-PSSession : Connecting to remote server failed with the following error me
    ssage : 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 firew
    all exception for Windows Remote Management service is enabled. For more informa
    tion, see the about_Remote_Troubleshooting Help topic.
    At line:1 char:16
    + Enter-PSSession <<<<  'win7' -Credential:'domain\username'
        + CategoryInfo          : InvalidArgument: (win7:String) [Enter-PSSession],
        PSRemotingTransportException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
     

    _____________________________________________________________________________
    PS C:\Windows\system32> Invoke-Command -ComputerName win7 -ScriptBlock {get-Service -DisplayName Windows Update | Stop-Service}
    [win7] 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 WinRM service, run the f
    ollowing command on the destination to analyze and configure the WinRM service:
    "winrm quickconfig". For more information, see the about_Remote_Troubleshooting
    Help topic.
        + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
        + FullyQualifiedErrorId : PSSessionStateBroken

    • Edited by allen357 Friday, February 12, 2010 5:04 AM type o
    Friday, February 12, 2010 4:57 AM

Answers

  • Hey

    You need to enable WinRM on your system. Open powershell on the system you want to connect to remotely and enable it by typing:

    C:>enable-psremoting -force
    WinRM already is set up to receive requests on this machine.
    WinRM has been updated for remote management.
    Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.

    This will configure WinRM for you. Check out this technet powershell training session.

    http://technet.microsoft.com/en-au/events/ee676904.aspx

    Hope that helps

    Cheers Matt :)
    Friday, February 12, 2010 5:43 AM
  • I am trying to understand this a bit
    So, the remoting session fails only in two scenarios

    1. when you try to connect from VM to desktop
    2. When you try to open Remote Tab in ISE on the desktop computer

    Is that right?

    Are you logged in as Administrator or a member of administrators group? Are you running this at an elevated prompt.


    Ravikanth
    http://www.ravichaganti.com/blog
    Twitter: @ravikanth
    Thursday, February 18, 2010 2:14 AM

All replies

  • Hey

    You need to enable WinRM on your system. Open powershell on the system you want to connect to remotely and enable it by typing:

    C:>enable-psremoting -force
    WinRM already is set up to receive requests on this machine.
    WinRM has been updated for remote management.
    Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.

    This will configure WinRM for you. Check out this technet powershell training session.

    http://technet.microsoft.com/en-au/events/ee676904.aspx

    Hope that helps

    Cheers Matt :)
    Friday, February 12, 2010 5:43 AM
  • Check the remoting series posts on my blog http://www.ravichaganti.com/blog/?cat=240
    I have listed various scenarios and troubleshooting a few issues.

    HTH
    Ravikanth
    http://www.ravichaganti.com/blog
    Twitter: @ravikanth
    Friday, February 12, 2010 11:34 AM
  • I am a newbie to Scripting been reading Windows PowerShell 2.0 Best Practices
    Have the basic VBS map drives and copy folders down but the fun begins with powershell right!!!

    powershell ise fails to start on any xp sp3 machine i have so i built a vm of win7 on a completely different machine

    I have 2 win7 pc  1 desktop 1 VM enabled winrm on both made sure all are running firewall exceptions even tried turning it off.

    I run get-service -computername win7  This works great  get-process and ANY other command variant dose not it errors no matter which way i try to run it fails  errors are below..  Changed names and domains for privacy.

    Any help would be greatly appreciated.

    thanks in advance



    PS C:\Windows\system32> Get-Process -ComputerName win7
    Get-Process : Couldn't connect to remote machine.
    At line:1 char:12
    + Get-Process <<<<  -ComputerName win7
        + CategoryInfo          : NotSpecified: (:) [Get-Process], InvalidOperation
       Exception
        + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerS
       ____.Commands.GetProcessCommand


    _____________________________________________________________________________
    PS C:\Windows\system32> Invoke-Command -ComputerName win7 -ScriptBlock {Get-Process}
    [win7] 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 excepti
    on for Windows Remote Management service is enabled. For more information, see t
    he about_Remote_Troubleshooting Help topic.
        + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
        + FullyQualifiedErrorId : PSSessionStateBroken

    _____________________________________________________________________________


    PS C:\Windows\system32> Enter-PSSession 'win7' -Credential:'domain\username'
    if ($?) {$psISE.CurrentPowerShellTab.DisplayName = 'win7'}
    Enter-PSSession : Connecting to remote server failed with the following error me
    ssage : 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 firew
    all exception for Windows Remote Management service is enabled. For more informa
    tion, see the about_Remote_Troubleshooting Help topic.
    At line:1 char:16
    + Enter-PSSession <<<<  'win7' -Credential:'domain\username'
        + CategoryInfo          : InvalidArgument: (win7:String) [Enter-PSSession],
        PSRemotingTransportException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
     

    _____________________________________________________________________________
    PS C:\Windows\system32> Invoke-Command -ComputerName win7 -ScriptBlock {get-Service -DisplayName Windows Update | Stop-Service}
    [win7] 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 WinRM service, run the f
    ollowing command on the destination to analyze and configure the WinRM service:
    "winrm quickconfig". For more information, see the about_Remote_Troubleshooting
    Help topic.
        + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
        + FullyQualifiedErrorId : PSSessionStateBroken


    First i would like to thank you matt and ravi for your fast response

    it fixed the remote issue from xp to windows 7 
    fixed it from w7 to xp in either psh or psh ise

    no luck going from w7 to w7 still gives the same error as above


    any idea on the psh ise issue in xp all i get is a windows error report 
    in 2k3 server it shows in taskmgr then disappears with no error report

     

    Friday, February 12, 2010 10:30 PM
  • So, talking about the Windows 7 computers you are using, are they in a domain or in workgroup?

    What is the output of following command when you run it locally on each Windows 7 PC? Remember, you have to run this from an elevated admin prompt.

    Enter-PSSession -Computer localhost
    Ravikanth
    http://www.ravichaganti.com/blog
    Twitter: @ravikanth
    Monday, February 15, 2010 6:39 AM
  • Yes they are in a domain

    outout from the command was [localhost]: PS C:\Users\username\Documents>  on both pc it look like it drop its permission level

    if i try to use the remote powershell tab it works on my VM w7 pc but not the desktop error message

    PS C:\Windows\system32> Enter-PSSession 'terminal' -Credential:'domain\username'
    if ($?) {$psISE.CurrentPowerShellTab.DisplayName = 'terminal'}
    Enter-PSSession : Connecting to remote server failed with the following error message : The WinRM cl
    ient 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 enabl
    ed. For more information, see the about_Remote_Troubleshooting Help topic.
    At line:1 char:16
    + Enter-PSSession <<<<  'terminal' -Credential:'domain\username'
        + CategoryInfo          : InvalidArgument: (win7:String) [Enter-PSSession], PSRemotingTransport
       Exception
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

    Tuesday, February 16, 2010 7:24 AM
  • I am trying to understand this a bit
    So, the remoting session fails only in two scenarios

    1. when you try to connect from VM to desktop
    2. When you try to open Remote Tab in ISE on the desktop computer

    Is that right?

    Are you logged in as Administrator or a member of administrators group? Are you running this at an elevated prompt.


    Ravikanth
    http://www.ravichaganti.com/blog
    Twitter: @ravikanth
    Thursday, February 18, 2010 2:14 AM
  • sorry its been so long that I'm repling to you

    i decided to blow up these two clients and start anew

    1st I found PowerGui with AD PowerPack much better at the remote thing its on ALL my nodes now.

    find it here: http://www.powergui.org/index.jspa 

     I would like to THANK YOU BOTH very much for your time and expertise in these issues.

    Thursday, April 22, 2010 1:24 PM
  • I was getting this error:

     

    Enter-PSSession : Connecting to remote server failed with the following error message : The WS-Management service cannot process the request. The resource URI (http://schemas.microsoft.com/powershell/Microsoft.PowerShell) was not found in the WS-Management catalog. The catalog contains the metadata that describes resources, or logical endpoints. For more information, see the about_Remote_Troubleshooting Help topic.

    At line:1 char:16

    + Enter-PSSession <<<<  ServerName

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

        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

     

     

    and after running this like MatthewBeattie said and it worked.

    C:>enable-psremoting -force

     

    Thanks a million!!!

    Wednesday, March 09, 2011 12:12 AM