qfarm /loadI have a problem with remote executing a script.
The script invokes a command for cmd qfarm /load
and converts the result to PSObjects.
function New-qLast()
{
param ([String] $qName, [String] $qLoad)
$qLast = New-Object PSObject
$qLast | Add-Member -MemberType NoteProperty -Name ServerName -Value $qName
$qLast | Add-Member -MemberType NoteProperty -Name ServerLast -Value $qLoad
return $qLast
}
Write-Host "Start"
$b = @()
foreach ($a in $(qfarm /load))
{
$b += $a.Split(" ") | Where-Object { $_ -ne "" }
}
$b
$table = @()
for ($i = 5; $i -lt $b.Length; $i += 2) #for XA 4.5 $i = 5 $i += 2; for XA 6.5 $i += 5 and $i = 8
{
$table += New-qLast $b[$i] $b[$i+1]
}
$table
as soon as it get's to invoking the qfarm /load
nothing is happening anymore.
When I execute the script directly on a terminal server it works fine.
I also tried to run Invoke-Command -ComputerName Server01 {qfarm /load}
that works for the first 22 servers of the farm then it's not returning anything but still running till you manually turn it off.
Has anyone an idea why it get's stuck?
Thanks in advance.