New Question
 
 
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 PRTG
Download >>

 

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

 

Top Tags


View all Tags


code: PE132

Votes:

0

Your Vote:

Up

Down

Hello,

I'm getting this error:

Response not wellformed: "(File C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\SqlChecker. ps1 cannot be loaded because the execution of scripts is disabled on this syste m. Please see "get-help about_signing" for more details. At line:1 char:2 + & <<<< 'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\SqlChe cker.ps1' 'Server=FQDN of server;Database=Master;User Id=XXXXXX;Password =XXXXXX;' 'SELECT Top 1 * FROM spt_monitor'; exit $LASTEXITCODE + CategoryInfo : NotSpecified: (:) [], PSSecurityException + FullyQualifiedErrorId : RuntimeException )" (code: PE132)

I've got the follwoing Powershell script:

param([string]$connectionString, [string]$query)

try
{
	$connection = New-Object System.Data.SqlClient.SqlConnection
	$connection.ConnectionString = $connectionString
	$connection.Open()

	$command = $connection.CreateCommand()
	$command.CommandText = $query

	$result = $command.ExecuteNonQuery()

	Write-Host "1:OK"
	Exit 0
}
catch [System.Data.SqlClient.SqlException]
{
	Write-Host "0:SQL exception"
	Exit 2
}
catch
{
	Write-Host "0:Error"
	Exit 2
}

The server running the Remote Probe and the target server have ExecutionPolicy set to Unrestricted (for testing) --> Set-ExecutionPolicy Unrestricted.

However, I'm still getting the same error. Could you guys point me in the right direction?

powershell remote-powershell sql

Created on Jan 29, 2015 8:34:57 AM by  Annfinn Thomsen (0) 1

Last change on Jan 29, 2015 8:43:53 AM by  Torsten Lindner [Paessler Support]



2 Replies

Votes:

10

Your Vote:

Up

Down

The PRTG Probe will call the 32bit Powershell, this is important for setting the ExecutionPolicy. Please check if you got the right Powershell.

Regards
Birk Guttmann

Created on Jan 29, 2015 10:12:42 AM by  Birk Guttmann (1,149) 4 1



Votes:

0

Your Vote:

Up

Down

Hello Birk

that worked, thanks a bunch! :)

Created on Jan 29, 2015 11:36:25 AM by  Annfinn Thomsen (0) 1



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.