I get the follow error running the PowerShell simple monitor script provided with PA service Monitoring.

Error executing PowerShell script. The type initializer for 'System.Management.Automation.SessionStateScope' threw an exception. [2]

Is there some special configuration to allow PowerShell Scripts to run?

Running Windows 2012 PA Server monitor version 5.2.0.55

asked 08 Nov '13, 14:40

disce's gravatar image

disce
160223
accept rate: 0%


Hi disce,

Can you provide the code that you are using in your monitor so that I can test on our side?

Thanks
Quinn

Please make sure to mark your questions accepted when you have your answer by clicking the gray check mark to the left of the answer.

link

answered 11 Nov '13, 11:53

Quinn's gravatar image

Quinn ♦♦
14.1k3925
accept rate: 37%

I get the error with the sample powershell scripts provided with PA server monitor

Code from PASM:
{removed comments for monitor}
$mon.FireActions = $true
$mon.Details = "Testing Execute Script monitor"
$statID = $mon.GetStatID("testStat")
$mon.RecordStat($statID, 10.5)

End of Code

link

answered 11 Nov '13, 22:42

disce's gravatar image

disce
160223
accept rate: 0%

edited 12 Nov '13, 16:11

Quinn's gravatar image

Quinn ♦♦
14.1k3925

Hi

Can you send me a screenshot of the error message that you are getting? I have tried to recreate the error on our test machines but am unable to do so using the default scrip (same as yours). When I test the monitor from the console (selecting the button "Test Script from Monitoring Service") I get the correct pop-up that says that the an alert would be fired.

Email address: support@poweraadmin.com

Thanks
Quinn

Please make sure to mark your questions accepted when you have your answer by clicking the gray check mark to the left of the answer.

link

answered 12 Nov '13, 12:16

Quinn's gravatar image

Quinn ♦♦
14.1k3925
accept rate: 37%

alt text

link

answered 12 Nov '13, 14:46

disce's gravatar image

disce
160223
accept rate: 0%

I also get the same error even if the entire script is blank.

link

answered 12 Nov '13, 14:48

disce's gravatar image

disce
160223
accept rate: 0%

I've been unable to get the same results on my testing machines. Please tell me more about your server. OS... version... etc. Is PowerShell installed on the server? Anything you can think of that might help test this issue.

Thanks
Quinn

Please make sure to mark your questions accepted when you have your answer by clicking the gray check mark to the left of the answer.

link

answered 13 Nov '13, 16:56

Quinn's gravatar image

Quinn ♦♦
14.1k3925
accept rate: 37%

Windows Server 2012 64 bit. All patches Running in a Microsoft Hyper-V server. This is a clean install of Windows 2012. PA Server Monitor version 5.2.2.112 I export the PA monitor settings from our old windows 2003 server and imported in to this server.

Powershell 3.0 is installed with Windows 2012 by default. No way I can see to uninstall

I can run powershell scripts from the server Error executing PowerShell script.

I ran the powershell command with no help Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

link

answered 13 Nov '13, 20:18

disce's gravatar image

disce
160223
accept rate: 0%

I'm not sure about your meaning of following statements, would you please explain?

"I can run powershell scripts from the server Error executing PowerShell script."
"I ran the powershell command with no help Set-ExecutionPolicy -ExecutionPolicy RemoteSigned"

Thanks
Quinn

Please make sure to mark your questions accepted when you have your answer by clicking the gray check mark to the left of the answer.

link

answered 14 Nov '13, 09:00

Quinn's gravatar image

Quinn ♦♦
14.1k3925
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×8
×1

Asked: 08 Nov '13, 14:40

Seen: 10,021 times

Last updated: 14 Nov '13, 09:00