Hi there

I'm trying to monitor our Skype for Business Servers - without much luck though :( How can I get my script to be run on the remote server itself?

Script:

$query = Get-CsWindowsService RTCMEDSRV
[string]$result = $query.ActivityLevel

[string[]]$splitResult = $result.Split('=,')[1,3,5,7]

[int]$InboundCalls     = $splitResult[0] -as [int]
[int]$OutboundCalls    = $splitResult[1] -as [int]
[int]$InboundPriCalls  = $splitResult[2] -as [int]
[int]$OutboundPriCalls = $splitResult[3] -as [int]

$InboundTotalCalls     = $InboundCalls + $InboundPriCalls
$OutboundTotalCalls    = $OutboundCalls + $OutboundPriCalls

Write-Output $InboundTotalCalls

PRTG Error: Response not well-formed: "(Get-CsWindowsService : The term 'Get-CsWindowsService' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Regards
Patrick


Article Comments

Attention: This article is a record of a conversation with the Paessler support team. The information in this conversation is not updated to preserve the historical record. As a result, some of the information or recommendations in this conversation might be out of date.

Hi there,

In order to run a script remotely, I would recommend to use Remote Powershell Commands.

Please also note, that the results need to be in the correct format, so PRTG can handle those correctly. How this syntax should look is explained here.


Kind regards,
Birk Guttmann, Tech Support Team


Jan, 2020 - Permalink