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

Powershell: NotSpecified: (:) [Get-XAFarm], FaultException

Votes:

0

I have the following powershell script:

Add-PSSnapin Citrix*
$ComputerName = [string]$Args[0]
if ($ComputerName -eq "")
{
 "<prtg><error>1</error><text>No Computername set in the parameters of the script</text></prtg>"
}
else
{
 $Sessions = Get-XAFarm -ComputerName "$ComputerName"
 $SessionCount = $Sessions.SessionCount
 "<prtg>"
 "<result>"
 "<channel>Current Session Count</channel>"
 "<value>" + $SessionCount + "</value>"
 "</result>"
 "</prtg>"
}

This script gives me the below stated error:

Get-XAFarm : De server kan de aanvraag niet verwerken als gevolg van een intern
e fout. Voor meer informatie over de fout kunt u IncludeExceptionDetailInFaults
 inschakelen (vanuit ServiceBehaviorAttribute of vanuit het configuratiegedrag 
<serviceDebug>) voor de server zodat de uitzonderingsgegevens naar de client wo
rden teruggestuurd, of u kunt tracering inschakelen. Raadpleeg hiertoe de docum
entatie van Microsoft .NET Framework 3.0 SDK en controleer de traceringslogboek
en voor de server.
At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\GetCurrent
XASessionCount.ps1:9 char:14
+  $Sessions = Get-XAFarm -ComputerName "$ComputerName"
+              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-XAFarm], FaultException
    + FullyQualifiedErrorId : System.ServiceModel.FaultException,Citrix.XenApp 
   .Commands.GetFarmCmdlet
 
<prtg>
<result>
<channel>Current Session Count</channel>
<value></value>
</result>
</prtg>

If i execute the script manually, it works. so what's wrong with my script...

custom-script-exe powershell prtg14

Created on Nov 18, 2015 3:48:20 PM

Last change on Nov 18, 2015 3:52:35 PM by  Torsten Lindner [Paessler Support]



1 Reply

Votes:

0

Hi Eagle,

Please try to start the script within another security context by marking Use Windows credentials of parent device in the settings of the sensor. Please ensure that you enter a user who has got sufficient rights to execute scripts on the probe system.

Best regards, Felix

Created on Nov 20, 2015 12:28:39 PM by  Felix Saure [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.