無法載入 Power Shell 嵌入式管理單元警示

Microsoft.SystemCenter.PowerShellModule.AlertOnFailedLoadSnapIn (Rule)

當規則或監視嘗試執行 Power Shell 指令碼,但 Power Shell 嵌入式管理單元無法載入時,會發出警示。

Knowledge Base article:

摘要

System Center 管理健全狀況服務嘗試執行某個 PowerShell 指令碼但無法載入 PowerShell 嵌入式管理單元。

這可能會影響到某些監視或目錄。

原因

這可能是由以下原因所造成:

解決方式

警示描述和內容會提供資訊指出失敗的規則或監視。以下連結將顯示指出 PowerShell 指令碼執行失敗的所有事件:

檢視 PowerShell 事件

檢閱其內容中的錯誤後,請檢查:

工作流程設定中的嵌入式管理單元名稱拼寫正確。

嵌入式管理單元及其相依項目已正確安裝在電腦上。

最後,您應該檢查確認動作帳戶具有足夠的存取權可執行嵌入式管理單元。

Element properties:

TargetMicrosoft.SystemCenter.HealthService
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableTrue
Alert Message
Power Shell 嵌入式管理單元無法載入
{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>