Alerte lorsque PowerShell n'est pas installé

Microsoft.SystemCenter.PowerShellModule.AlertOnPowerShellNotInstalled (Rule)

Avertit lorsque des scripts PowerShell sont utilisés alors que PowerShell n'est pas installé.

Knowledge Base article:

Résumé

L'exécution du script PowerShell a échoué en raison de la mauvaise installation de PowerShell.

Cela peut affecter une partie de l'analyse ou de la détection.

Causes

Les raisons de ce problème peuvent être les suivantes :

Résolutions

La description et le contexte de l'alerte contiennent des informations indiquant la règle ou l'analyse ayant échoué. Le lien suivant affichera tous les événements indiquant l'échec de l'exécution du programme exécutable :

Afficher les événements PowerShell

Après avoir examiné l'erreur dans son contexte, vérifiez :

que la règle s'exécute correctement sur une machine qui doit héberger PowerShell ;

que PowerShell est installé correctement.

Element properties:

TargetMicrosoft.SystemCenter.HealthService
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableTrue
Alert Message
PowerShell n'est pas correctement installé.
{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.AlertOnPowerShellNotInstalled" 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">22403</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.AlertOnPowerShellNotInstalled.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue>$Target/Id$</SuppressionValue>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>