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

"The handle is invalid. (0x6)" - Custom Powershell Scripts

Votes:

0

Upgraded to Powershell 3.0 (http://www.microsoft.com/en-us/download/details.aspx?id=34595) to use some of the new commands.

PS C:\Windows\system32> $Host.Version Major Minor Build Revision ----- ----- ----- -------- 3 0 -1 -1

PS C:\Windows\system32> Get-ExecutionPolicy RemoteSigned

32-bit powershell queried

Now all of my custom powershell scripts are returning "The handle is invalid. (0x6)". Dumping exe output does not create any files. Sounds like a problem with PRTG calling powershell?

Even a simple: Write-Output "<prtg>" is failing with the same error.

Any ideas? Thanks -Andrew

custom-sensor error powershell

Created on Nov 23, 2012 6:38:11 PM



4 Replies

Votes:

0

Hi,
may you try running the following command in cmd: C:\Windows\powershell.exe -Noninteractive -Command "&'"C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\YOUREXECUTABLE"';" Does that deliver the correct output?
Best regards

Created on Nov 26, 2012 2:26:04 PM by  Konstantin Wolff [Paessler Support]



Votes:

0

Hi,
please reboot the machine once again (even if there has been a reboot after the Powershell update), this should fix the issue.
Best regards

Created on Nov 27, 2012 1:42:36 PM by  Konstantin Wolff [Paessler Support]



Votes:

0

Hello Konstantin, I work with Andrew and he asked me to test these solutions. The second reboot did resolve the issue. I guess Microsoft needs to update their release notes to mention that.

Thanks for the help!

Created on Dec 4, 2012 8:00:07 PM



Votes:

0

Hello Daryl,
we are finally suspecting that with the Powershell 3.0 update the environment variables weren't updated correctly (which then happened with the second reboot). This might have caused the issues.
Best regards

Created on Dec 4, 2012 8:09:41 PM by  Konstantin Wolff [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.