What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

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

Votes:

0

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

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



1 Reply

Votes:

0

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]




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.