简体   繁体   English

PowerShell Invoke-Command返回“套接字连接已中止”

[英]PowerShell Invoke-Command returning “The socket connection was aborted”

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): 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. 我正在运行PowerShell(3.0版)脚本以从服务器列表中获取Citrix XenApp 6.5信息,但是我在某些服务器(02和03演示服务器,请参见下面的脚本)上收到以下错误消息: 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. 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.

Here's the script I'm running: 这是我正在运行的脚本:

$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
}

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. 我进行了搜索,但只找到一个与PowerShell和Citrix相关的链接,但由于我正在远程运行命令,因此该链接似乎不适用于我。 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. 我看过的其他链接似乎都与我的情况不符,也没有对错误进行很好的解释,以帮助解决问题。

I am not running the Citrix XenApp 6.5 SDK on my local machine, which is where I'm running the scripts from. 我不在本地计算机上运行Citrix XenApp 6.5 SDK,这是我从中运行脚本的位置。 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. 我尝试开发的解决方案可能会分发给没有SDK且无法安装SDK的用户,因此我尝试避免在本地使用它。

The SDK is installed on each server and I can run the commands successfully from the server. SDK安装在每台服务器上,我可以从服务器成功运行命令。 Local machine and servers are both running PowerShell 3.0. 本地计算机和服务器都在运行PowerShell 3.0。

Does anyone know what's causing the error, why it's only occurring on the 02 & 03 presentation servers, and how I can resolve it? 有谁知道导致该错误的原因,为何仅在02&03演示服务器上发生该错误以及如何解决该错误? I'm new to Citrix and trying to learn on the fly. 我是Citrix的新手,正在尝试快速学习。

Thanks. 谢谢。

Param $s应该是param ($server)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM