OpsMgr 2012 Self Maintenance Approve Manual Agents Rule

OpsMgr.2012.Self.Maintenance.Approve.Manual.Agents.Rule (Rule)

Approve Manual Agents based on agents computer name and domain name regular expression match

Knowledge Base article:

Summary

The “OpsMgr 2012 Self Maintenance Approve Manual Agents Rule” runs on a schedule and approve manually installed agents of which computer name and domain name match the configurable computer name and domain name regular expression.

Configuration

This rule can be customized using overrides:

IntervalMinutes: How often (in minutes) does this rule run.

AgentNameRegex: Regular Expression for acceptable Agent computer names

AgentDomainRegex: Regular Expression for acceptable Agent domain names

MaxToApprove: Maxinum number of manually installed agents to be approved at a time.

SyncTime: What time does this rule run.

TimeoutSeconds: Timeout in seconds for the PowerShell script inside the rule.

This rule will approve manually installed agents (up to the number configured for MaxToAPprove) if both agent's computer name and domain name match configured regular expressions.

Causes

An information alert is generated if the rule has approved at least one (1) agent(s).

Resolutions

No further actions are required.

Element properties:

TargetMicrosoft.SystemCenter.AllManagementServersPool
CategoryOperations
EnabledFalse
Alert GenerateTrue
Alert SeverityInformation
Alert PriorityLow
RemotableTrue
Alert Message
Some Manually Installed Agents have been approved

According to the agent computer name and domain name regular expression configured in the OpsMgr 2012 Self Maintenance Approve Manual Agents Rule, {3} manually installed agent(s) have been approved.

Agent Computer Name Regex: {0}
Agent Domain name Regex: {1}

Please Check to the alert context for the list of approved agents.

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource OpsMgr.2012.Self.Maintenance.Approve.Manual.Agents.DataSource Default
FilterResult ConditionDetection System.ExpressionFilter Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="OpsMgr.2012.Self.Maintenance.Approve.Manual.Agents.Rule" Target="SC!Microsoft.SystemCenter.AllManagementServersPool" Enabled="false" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Operations</Category>
<DataSources>
<DataSource ID="DS" TypeID="OpsMgr.2012.Self.Maintenance.Approve.Manual.Agents.DataSource">
<IntervalMinutes>15</IntervalMinutes>
<AgentNameRegex>ENTER AGENT NAME REGULAR EXPRESSION</AgentNameRegex>
<AgentDomainRegex>ENTER AGENT DOMAIN REGULAR EXPRESSION</AgentDomainRegex>
<MaxToApprove>0</MaxToApprove>
<TimeoutSeconds>120</TimeoutSeconds>
</DataSource>
</DataSources>
<ConditionDetection ID="FilterResult" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='ApprovedCount']</XPathQuery>
</ValueExpression>
<Operator>Greater</Operator>
<ValueExpression>
<Value Type="Integer">0</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
<Priority>0</Priority>
<Severity>0</Severity>
<AlertMessageId>$MPElement[Name="OpsMgr.2012.Self.Maintenance.Approve.Manual.Agents.Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/Property[@Name='AgentNameRegex']$</AlertParameter1>
<AlertParameter2>$Data/Property[@Name='AgentDomainRegex']$</AlertParameter2>
<AlertParameter3>$Data/Property[@Name='ApprovedComputers']$</AlertParameter3>
<AlertParameter4>$Data/Property[@Name='ApprovedCount']$</AlertParameter4>
<AlertParameter5>$Data/Property[@Name='MaxToApprove']$</AlertParameter5>
</AlertParameters>
</WriteAction>
</WriteActions>
</Rule>