Need Help with Remoting

Welcome Forums General PowerShell Q&A Need Help with Remoting

This topic contains 1 reply, has 2 voices, and was last updated by

5 years, 4 months ago.

  • Author
  • #10836

    Points: 0
    Rank: Member

    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

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    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.

The topic ‘Need Help with Remoting’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort