New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


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

Votes:

0

Your Vote:

Up

Down

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 by  Andrew (50) 1 1



4 Replies

Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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 by  Daryl (0) 1



Votes:

0

Your Vote:

Up

Down

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]



Please log in or register to enter your reply.


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.