Quantcast
Channel: THWACK: Discussion List - All Communities
Viewing all articles
Browse latest Browse all 16365

SAM Powershell Citrix Server Monitoring

$
0
0

Hoping someone here can give me a hand. I have a script to check for offline servers in Citrix that we are trying to run from SAM. I have tested the below script through powershell on the polling engine against the remote server via the invoke method. It works flawlessly that way. When trying to set it up in SAM I get Output Result: Not Defined. Here is the script:

 

Add-PSSnapin Citrix.XenApp.Commands

 

$AllXAServers = Get-XAServer | Sort-Object ServerName

 

$XAServers = @()

ForEach( $XAServer in $AllXAServers )

{

       $XAServers += $XAServer.ServerName

}

 

$OnlineXAServers = Get-XAZone | Get-XAServer -OnlineOnly | Sort-Object ServerName

 

$OnlineServers = @()

ForEach( $OnlineServer in $OnlineXAServers )

{

       $OnlineServers += $OnlineServer.ServerName

}

 

$OfflineServers = @()

ForEach( $Server in $XAServers )

{

       If( $OnLineServers -notcontains $Server )

       {

              $OfflineServers += $Server

       }

}

 

Write-Output $OfflineServers

 

I know there are probably some changes in regards to the write-output and I think that I have to have a statistic line but a bit lost there.


Viewing all articles
Browse latest Browse all 16365

Trending Articles