Hello,
Yesterday I updated our PRTG server from 20.3.61.1649 to 21.3.69.1333. After that our EXE/script sensors that check Registration state and Amount of sessions of Citrix servers did not work anymore. I did not create the script, but is has been running without problems for at least six years.
The response I get:
Response not well-formed: "(The method or operation is not implemented. A command that prompts the user failed because the host program or the command type does not support user interaction. Try a host program that supports user interaction, such as the Windows PowerShell Console or Windows PowerShell ISE, and remove prompt-related commands from command types that do not support user interaction, such as Windows PowerShell workflows. )" (code: PE132)
I don't really have powershell knowledge, but the code is or was correct since it ran for 6 years without errors. As the PRTG upgrade to the new version is the cause of the issue, I would appreciate some help here. I could not find any powershell related changes in the PRTG release notes between the old and new version. So please find one of the two scripts below, hostnames a.s.o. have been anonymized with <string>.
Set-ExecutionPolicy Unrestricted -force # Get credentials for remote session $username = "<domain\user>" $secureString = Get-Content -Path C:\Scripts\PSRemotingCredentials\storedPassword.txt | ConvertTo-SecureString $password = $secureString = Get-Content -Path C:\Scripts\PSRemotingCredentials\storedPassword.txt | ConvertTo-SecureString $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password # Open PS Remoting session on DDC (Citrix Desktop Delivery Controller) $s = new-pssession -computername <DDC host name> -Credential $cred # Load Citrix snap-in invoke-command -session $s {Add-PSSnapin -Name Citrix.*} # Query amount of sessions on CTX server $SessionCnt = invoke-command -session $s {(Get-BrokerMachine -MachineName <domain\citrixserver>).SessionCount} Exit-PSSession if ($SessionCnt -gt 20) { $x=[string]$SessionCnt+":Down" write-host $x exit 2 } ElseIf ($SessionCnt -gt 15) { $x=[string]$SessionCnt+":Warning" write-host $x exit 1 } Else { $x=[string]$SessionCnt+":OK" write-host $x exit 0 }
Add comment