Scheduled Task Monitoring compatibility

Custom.TaskSchedulerV2.PowerShellCompatible.Monitor (UnitMonitor)

The "Windows Task Scheduler and PS Job Monitoring" management pack uses PowerShell to discover and monitor scheduled tasks.
If Powershell is not installed, the management pack will fail to discover tasks and jobs.

Knowledge Base article:

Summary

PowerShell Version >= 2.0 is required for scheduled task and PowerShell scheduled job monitoring.

Resolutions

Download and install PowerShell 2.0 or later on this agent computer from www.microsoft.com

Element properties:

TargetMicrosoft.Windows.OperatingSystem
Parent MonitorSystem.Health.ConfigurationState
CategoryConfigurationHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeCustom.Windows.TaskSchedulerV2.Registry2StateMonitorType
RemotableFalse
AccessibilityInternal
Alert Message
Task Scheduler Monitoring is not possible
PowerShell is not installed on computer {0} or the installed version is not compatible with PowerShell 2.0.

In order to monitor scheduled tasks, install the appropriate PowerShell environment (>= Version 2.0).
RunAsDefault

Source Code:

<UnitMonitor ID="Custom.TaskSchedulerV2.PowerShellCompatible.Monitor" Accessibility="Internal" Enabled="true" Target="Windows!Microsoft.Windows.OperatingSystem" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="false" Priority="Normal" TypeID="Custom.Windows.TaskSchedulerV2.Registry2StateMonitorType" ConfirmDelivery="false">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Custom.TaskSchedulerV2.PowerShellCompatible.Monitor_AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="PS2_Compatible" MonitorTypeStateID="FirstCondition" HealthState="Success"/>
<OperationalState ID="NotPS2_Compatible" MonitorTypeStateID="SecondCondition" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
<WindowsVersionRegEx>^6\.</WindowsVersionRegEx>
<RegistryAttributeDefinitions>
<!-- PoSh 1.0 & 2.0 -->
<RegistryAttributeDefinition>
<AttributeName>PSCompatibleVersionV1</AttributeName>
<Path>SOFTWARE\Microsoft\Powershell\1\PowerShellEngine\PSCompatibleVersion</Path>
<PathType>1</PathType>
<AttributeType>1</AttributeType>
<RegistryView>Default</RegistryView>
</RegistryAttributeDefinition>
<!-- PoSh >= 3.0 -->
<RegistryAttributeDefinition>
<AttributeName>PSCompatibleVersionV3</AttributeName>
<Path>SOFTWARE\Microsoft\Powershell\3\PowerShellEngine\PSCompatibleVersion</Path>
<PathType>1</PathType>
<AttributeType>1</AttributeType>
<RegistryView>Default</RegistryView>
</RegistryAttributeDefinition>
</RegistryAttributeDefinitions>
<Frequency>3600</Frequency>
<FirstExpression>
<Or>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery Type="String">Values/PSCompatibleVersionV1</XPathQuery>
</ValueExpression>
<Operator>MatchesRegularExpression</Operator>
<Pattern>2\.0</Pattern>
</RegExExpression>
</Expression>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery Type="String">Values/PSCompatibleVersionV3</XPathQuery>
</ValueExpression>
<Operator>MatchesRegularExpression</Operator>
<Pattern>.\..</Pattern>
</RegExExpression>
</Expression>
</Or>
</FirstExpression>
<SecondExpression>
<And>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery Type="String">Values/PSCompatibleVersionV1</XPathQuery>
</ValueExpression>
<Operator>DoesNotMatchRegularExpression</Operator>
<Pattern>2\.0</Pattern>
</RegExExpression>
</Expression>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery Type="String">Values/PSCompatibleVersionV3</XPathQuery>
</ValueExpression>
<Operator>DoesNotMatchRegularExpression</Operator>
<Pattern>.\..</Pattern>
</RegExExpression>
</Expression>
</And>
</SecondExpression>
</Configuration>
</UnitMonitor>