Need Help with Remoting

This topic contains 1 reply, has 2 voices, and was last updated by  Don Jones 4 years, 7 months ago.

  • Author
  • #10836

    Skip Hong

    I created a simple script to query for Powershell version on a number of remote servers, but it is not working. Here is the error
    New-PSSession : [win2k81] Connecting to remote server win2k81 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.

    My script is the following:

    $servers=get-content c:\servers.txt
    $s = New-PSSession -ComputerName (Get-Content c:\Servers.txt) -Credential home\administrator -ThrottleLimit 10
    Foreach($server in $servers){
    $results+=Invoke-Command -Session $s -Computername $server -Scriptblock {$PSVersionTable.psversion} |
    Select-Object PSComputerName, Major
    $results=export-csv c:\PSVer.csv

  • #10839

    Don Jones

    The error indicates that one of the computers (win2k81) you specified could not be contacted. It's possible it does not have Remoting enabled, or that it was not accessible, or that a firewall was blocking the traffic. Pretty much what the error message says.

You must be logged in to reply to this topic.