PowerShell Scripts time out on different Hyper-V hosts

In SCOM 2012 R2, I see a lot of alerts on my monitored Hyper-V servers: Forced to terminate the following PowerShell script because it ran past the configured timeout 300 seconds.

Script Name: DiscoverHyperV2012R2VirtualMachine.ps1 OR GetHyperVMeteringUsage OR GetDiskPartitionSpaceV2.ps1 OR VirtualMachineReplicaDiscoveryPS.ps1

When I zoom in on the Operations Manager log on 1 of the Hyper-V host machines, I see that the script is running and creation informational events in the log until some seconds before the timeout.

The Hyper-V hosts run a lot of VM's (60 or more). So is it possible that the timeout of 300 seconds just is too low?

How to fix this? I want the ps scripts to run without being ended prematurely.

Regards,

Stephan van de

September 1st, 2015 2:58am

Hi

There is good general guidance here albeit it is more related to WMI errors rather than timeouts:

http://blogs.technet.com/b/kevinholman/archive/2009/06/29/getting-lots-of-script-failed-to-run-alerts-wmi-probe-failed-execution-backward-compatibility-script-error.aspx

Especially with regards to personalising the alert view to see the repeat count. If the timeout is just a couple of times a day for a script that runs every 15 minutes then it is less important than a script that is constantly timing out.

If you do wish to change the timeout then the rules and monitors will have an override that allows you to change this value. I'd just be careful as this could put additional load on the Hyper-V hosts and impact their performance.

Regards

Graham

Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 5:23am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics