Nothing but -hostname %host. Here's the script:
param (
[string]$hostname
)
$LogonMode = Invoke-Command { Add-PSSnapin Citrix.XenApp.Commands; $(Get-XAServer -ServerName $hostname).LogonMode } -ComputerName $hostname | Select -Expand Value
If ($LogonMode -eq "AllowLogOns")
{write-host "0:All Logons Allowed"
exit 0}
ElseIf ($LogonMode -eq "ProhibitNewLogOnsUntilRestart")
{write-host "1:Prohibit Logons Until Server Restart"
exit 1}
ElseIf ($LogonMode -eq "ProhibitNewLogOns")
{write-host "2:Prohibit Logons Only"
exit 1}
ElseIf ($LogonMode -eq "ProhibitLogOns")
{write-host "3:Prohibit Logons and Reconnections"
exit 1}
Else
{exit 1}
It's simply identifying the logon mode of a XenApp server. If I run this directly on a XenApp server, the ELSEIF's are processed correctly according to its actual logon mode.
When prtg runs it, it constantly stops at "0:All Logons Allowed".
Add comment