theangryangel / prtg-addons

:warning: I no longer use PRTG at work, this repo is effectively here for archive purposes
3 stars 4 forks source link

Error on Windows Server 2016 #2

Closed dvanboven closed 5 years ago

dvanboven commented 6 years ago

Currently I'm using this PowerShell script within our PRTG setup.

It's working fine on our "Windows Server 2008 R2" servers. But when I execute it towards our "Windows Server 2016", it gives the following error:

Write-Debug : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Message'. Specified method is not supported.
At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\Get-DFSRBacklog.ps1:245 char:37
+                         write-debug $BacklogCount
+                                     ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Write-Debug], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.WriteDebugCommand

Do you know how to fix this error? Thanks in advance.

Kind Regards!

theangryangel commented 6 years ago

I am out of the country and unable to look at this for at least 2 weeks. I can tell you the backlog count is getting set to something it probably shouldn’t but until I get to a computer it’s difficult for me to tell you more.

Sent from my iPhone

On 15 Jun 2018, at 16:20, dvanboven notifications@github.com wrote:

Currently I'm using this PowerShell script within our PRTG setup.

It's working fine on our "Windows Server 2008 R2" servers. But when I execute it towards our "Windows Server 2016", it gives the following error:

Write-Debug : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Message'. Specified method is not supported. At C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\Get-DFSRBacklog.ps1:245 char:37

  • write-debug $BacklogCount
  • 
    + CategoryInfo          : InvalidArgument: (:) [Write-Debug], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.WriteDebugCommand
    Do you know how to fix this error?
    Thanks in advance.

Kind Regards!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

dvanboven commented 6 years ago

Alright, not a problem. Keep me posted.

theangryangel commented 5 years ago

With thanks to @Juzzle1 for 2 fixes here :) Nice one dude :+1: