What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

EXE/Script erro after update to 21.3.69.1333

Votes:

1

Your Vote:

Up

Down

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
}

exe pe132 prtg

Created on Jul 22, 2021 8:30:53 AM by  Han (1) 1

Last change on Jul 22, 2021 12:30:30 PM by  Felix Wiesneth [Paessler Support]



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

Hi there,

Does the issue also occurs when you are using write-output instead of write-host? Please exchange this in your script and check if the issue occurs again.


Kind regards

Felix Wiesneth - Team Tech Support

Created on Aug 4, 2021 6:46:59 AM by  Felix Wiesneth [Paessler Support]



6 Replies

Votes:

0

Your Vote:

Up

Down

After this update we've seen the same behavior in some powershell scripts as well. We've found no solution yet.

Created on Aug 3, 2021 1:30:03 PM by  RemcoB (30) 1



Accepted Answer

Votes:

0

Your Vote:

Up

Down

Hi there,

Does the issue also occurs when you are using write-output instead of write-host? Please exchange this in your script and check if the issue occurs again.


Kind regards

Felix Wiesneth - Team Tech Support

Created on Aug 4, 2021 6:46:59 AM by  Felix Wiesneth [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi Felix,

We received the suggestion of your colleague to switch off the experimental feature "PowerShell Security Enhancement" and that did the trick for this sensor.

Will try your suggestion as well and will post my findings here.

R

Created on Aug 4, 2021 7:30:51 AM by  RemcoB (30) 1



Votes:

0

Your Vote:

Up

Down

Hi Felix,

Your "write-output" works smoothly together with the new feature "PowerShell Security Enhancement".

Thanks for your help!

Rgds, Remco

Created on Aug 4, 2021 7:51:24 AM by  RemcoB (30) 1



Votes:

0

Your Vote:

Up

Down

Hello, Sorry for late reply, after a week I forgot about the topic.

Repalcing write-host with write-output did the trick, the above script works again. Thanks.

Created on Aug 5, 2021 2:02:50 PM by  Han (1) 1



Votes:

0

Your Vote:

Up

Down

Hi Han,

Glad to hear that it is working now.


Kind regards

Felix Wiesneth - Team Tech Support

Created on Aug 5, 2021 6:32:04 PM by  Felix Wiesneth [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.