Windows Update Agent Inventory Cycle Rule

Microsoft.SystemCenter.Essentials.AUAgentUpdate.InventoryCycleRule (Rule)

This rule triggers an inventory cycle on the Windows Update Client after the client has been updated.

Element properties:

TargetMicrosoft.Windows.Computer
CategoryOperations
EnabledTrue
Event_ID19
Event SourceWindowsUpdateClient
Alert GenerateFalse
RemotableTrue
Event LogSystem

Member Modules:

ID Module Type TypeId RunAs 
EventDS DataSource Microsoft.Windows.EventProvider Default
WA WriteAction Microsoft.Windows.ScriptWriteAction Default

Source Code:

<Rule ID="Microsoft.SystemCenter.Essentials.AUAgentUpdate.InventoryCycleRule" Target="Windows!Microsoft.Windows.Computer" Enabled="onEssentialMonitoring" ConfirmDelivery="true">
<Category>Operations</Category>
<DataSources>
<DataSource ID="EventDS" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>System</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>WindowsUpdateClient</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>19</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery Type="String">EventDescription</XPathQuery>
</ValueExpression>
<Operator>ContainsSubstring</Operator>
<Pattern>Windows Update Core</Pattern>
</RegExExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WA" TypeID="Windows!Microsoft.Windows.ScriptWriteAction">
<ScriptName>GenerateInventory.vbs</ScriptName>
<Arguments/>
<ScriptBody><Script>
SetLocale("en-us")
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("wuauclt /detectnow")
</Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</WriteAction>
</WriteActions>
</Rule>