This Datasource checks DNS Trust Point Status in all Windows Server 2012 R2
This Datasource gets Trust Point States in Windows Server 2012 R2 computers using a powershell commandlet
IntervalSeconds: How frequently (in seconds) the value should be checked.
SyncTime: Synchronization time for the module execution.
TimeoutSeconds: How much time (in seconds) to wait for the module to finish execution.
Type | DataSourceModuleType |
Isolation | Any |
Accessibility | Public |
RunAs | Default |
OutputType | System.PropertyBagData |
ID | Module Type | TypeId | RunAs |
---|---|---|---|
DS | DataSource | System.Discovery.Scheduler | Default |
PS | ProbeAction | Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe | Default |
InstanceFilter | ConditionDetection | System.ExpressionFilter | Default |
ID | ParameterType | Selector | Display Name | Description |
---|---|---|---|---|
IntervalSeconds | int | $Config/IntervalSeconds$ | Interval seconds | How frequently (in seconds) the value should be sampled. |
SyncTime | string | $Config/SyncTime$ | Sync Time | Synchronization time for the module execution. |
TimeoutSeconds | int | $Config/TimeoutSeconds$ | Timeout Seconds | How much time (in seconds) to wait for the module to finish execution. |
<DataSourceModuleType ID="Microsoft.Windows.Server.DNS.2012.R2.TrustPointState.DS" Accessibility="Public" Batching="false">
<Configuration>
<xsd:element minOccurs="1" name="TrustPointName" type="xsd:string"/>
<xsd:element minOccurs="1" name="ComputerName" type="xsd:string"/>
<xsd:element minOccurs="1" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element minOccurs="1" name="SyncTime" type="xsd:string"/>
<xsd:element minOccurs="1" name="TimeoutSeconds" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="System!System.Discovery.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval>$Config/IntervalSeconds$</Interval>
<SyncTime>$Config/SyncTime$</SyncTime>
</SimpleReccuringSchedule>
<ExcludeDates/>
</Scheduler>
</DataSource>
<ProbeAction ID="PS" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe">
<ScriptName>DNSTrustPointState2012R2Probe</ScriptName>
<ScriptBody>
param ([String] $PrincipalName)
$SCRIPT_NAME = "DNSTrustPointState2012R2Probe"
$ErrorActionPreference = "Stop"
# Event type constants
$EVENT_TYPE_LOG = 0
$EVENT_TYPE_ERROR = 1
$EVENT_TYPE_WARNING = 2
$EVENT_TYPE_INFORMATION = 4
# Typed property bag constants
$PROPERTY_TYPE_ALERT = 0
$PROPERTY_TYPE_EVENT = 1
$PROPERTY_TYPE_PERFORMANCE = 2
$PROPERTY_TYPE_STATE = 3
# State type constants
$STATE_SUCCESS = "Success"
$STATE_WARNING = "Warning"
$STATE_ERROR = "Error"
$momAPI = new-object -comObject MOM.ScriptAPI
Write-Host "$SCRIPT_NAME - Executing DNS 2012 Trusted Points Probe Powershell Script"
$DNSTrustPoints = Get-DnsServerTrustPoint -ComputerName $PrincipalName
if($DNSTrustPoints -ne $null)
{
if($DNSTrustPoints.Count -eq $null)
{
$TPCount = 1
}
else
{
$TPCount = $DNSTrustPoints.Count
}
for ($itmTP=0; $itmTP -lt $TPCount; $itmTP++)
{
if($TPCount -eq 1)
{
$TPObj = $DNSTrustPoints
}
else
{
$TPObj = $DNSTrustPoints.Item($itmTP)
}
$TPState = $TPObj.TrustPointState
$PropertyBag = $momAPI.CreatePropertyBag()
$PropertyBag.AddValue("TrustPointName", $TPObj.TrustPointName)
$PropertyBag.AddValue("TrustPointState", $TPState)
$PropertyBag
Write-Host "$SCRIPT_NAME - Property Bag Added"
}
}
Write-Host "$SCRIPT_NAME - multiple property bag returned"
</ScriptBody>
<Parameters>
<Parameter>
<Name>PrincipalName</Name>
<Value>$Config/ComputerName$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</ProbeAction>
<ConditionDetection ID="InstanceFilter" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='TrustPointName']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/TrustPointName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="InstanceFilter">
<Node ID="PS">
<Node ID="DS"/>
</Node>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>