title: PowerShell Invoke-Command returning "The socket connection was aborted"
body: <p>I'm running a PowerShell (version 3.0) script to obtain Citrix XenApp 6.5 info from a list of servers, but I'm receiving the following error message on some of the servers (the 02 and 03 presentation servers, see script below): <code>The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue.</code></p>
  
  <p>Here's the script I'm running:</p>
  
  <pre><code>$servers = "license_server01", "presentation_server01", "presentation_server02", "presentation_server03",
  $scriptblock = {
      param ($s)
  
      Add-PSSnapin Citrix.*
  
      Write-Host "--------------------"
      Write-Host "Server: $s"
      Write-Host "--------------------"
      Get-XAServer | Select-Object ServerName, CitrixVersion
  }
  
  foreach ($server in $servers)
  {
      Invoke-Command -ComputerName $server -ScriptBlock $scriptblock -ArgumentList $server
  }
  </code></pre>
  
  <p>I searched, but only found one link that was related to PowerShell and Citrix, but it didn't appear to apply to me since I'm running the command remotely. None of the other links I viewed seemed to match my situation, nor did they provide a good explanation of the error that would help troubleshoot the problem.</p>
  
  <p>I am not running the Citrix XenApp 6.5 SDK on my local machine, which is where I'm running the scripts from. The solution I'm attempting to develop will likely get distributed to users that do not have the SDK and won't be able to install the SDK, so I'm trying to avoid using it locally.</p>
  
  <p>The SDK is installed on each server and I can run the commands successfully from the server. Local machine and servers are both running PowerShell 3.0.</p>
  
  <p>Does anyone know what's causing the error, why it's only occurring on the 02 &amp; 03 presentation servers, and how I can resolve it? I'm new to Citrix and trying to learn on the fly.</p>
  
  <p>Thanks.</p>