加载 PowerShell 管理单元失败的警报

Microsoft.SystemCenter.PowerShellModule.AlertOnFailedLoadSnapIn (Rule)

当规则或监视器尝试执行 PowerShell 脚本,且 Powershell 管理单元无法加载时生成警报。

Knowledge Base article:

摘要

运行状况服务正尝试运行 PowerShell 脚本,但无法加载 PowerShell 管理单元。

这将会影响某些监视或发现。

原因

这可能是以下原因引起的:

解决方法

警报描述和上下文包含指明哪个规则或监视器失败的信息。以下链接将显示指示运行 PowerShell 脚本失败的所有事件:

查看 PowerShell 事件

查看了上下文中的错误之后,请检查:

工作流配置中管理单元名称的拼写是否正确。

管理单元及其依赖关系是否正确安装在计算机上。

最后应检查以验证操作帐户是否具有访问管理单元的足够权限。

Element properties:

TargetMicrosoft.SystemCenter.HealthService
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableTrue
Alert Message
PowerShell 管理单元加载失败
{0}
Event LogOperations Manager

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.EventProvider Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SystemCenter.PowerShellModule.AlertOnFailedLoadSnapIn" Enabled="true" Target="SCLibrary!Microsoft.SystemCenter.HealthService" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Alert</Category>
<DataSources>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Operations Manager</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Health Service Modules</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Params/Param[1]</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Target/ManagementGroup/Name$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="UnsignedInteger">22401</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SystemCenter.PowerShellModule.AlertOnFailedLoadSnapIn.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue>$Data/Params/Param[7]$</SuppressionValue>
<SuppressionValue>$Data/Params/Param[8]$</SuppressionValue>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>