New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.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


Exchange 2016 Count script - XML Parser mismatch: - (code: PE231)

Votes:

0

Your Vote:

Up

Down

Hi,

Im trying to run a script in PRTG that display how many mailboxes have Mailbox Auditing Enabled.

$Truecount = Get-Mailbox -filter {(servername -eq "<ommitted>" -or servername -eq "<ommitted>" -or servername -eq "<ommitted>") -and (AuditEnabled -eq $True)} | measure | % { $_.Count }

Write-Host @"
<prtg>
  <result>
    <channel>First channel</channel>
    <value>$Truecount</value>
    </result>
</prtg>
"@

The script runs perfectly on Both the EXCHANGE server and on the PRTG Probe

Here are the results

<prtg>
  <result>
    <channel>First channel</channel>
    <value>2</value>
    </result>
</prtg>

But when i put the Sensor in PRTG i get the following error.

XML: XML Parser mismatch: Wanted </<<<>, got </prtg> -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)

I know its not the prettiest script (im a newbie), but surely the XML output is correct.

THanks

exchange prtg xmlexesensor

Created on Jun 8, 2018 2:42:32 AM by  TheWanKing (0) 1

Last change on Jun 8, 2018 6:46:31 AM by  Dariusz Gorka [Paessler Support]



1 Reply

Votes:

0

Your Vote:

Up

Down

Hi there,

Please activate the "Write EXE result to disk" option in the sensor's settings and post the log files (Result of Sensor XXX.Data.txt and Result of Sensor XXX.txt) located on the corresponding probe under "C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)".

Best regards

Created on Jun 8, 2018 10:43:26 AM by  Dariusz Gorka [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.