Cette source de données détecte Est une propriété de zone signée dans toutes les zones des serveurs Windows 2012 R2
Cette source de données détecte Est une propriété de zone signée dans toutes les zones des serveurs Windows 2012 R2 à l'aide d'un applet de commande Powershell
Intervalle en secondes : À quelle fréquence (en secondes) la valeur doit être vérifiée.
Heure de synchronisation : Heure de synchronisation pour l'exécution du module.
Délai d'attente (secondes) : Le délai d'attente (en secondes) jusqu'à la fin d'exécution du module.
Type | DataSourceModuleType |
Isolation | Any |
Accessibility | Public |
RunAs | Default |
OutputType | System.Discovery.Data |
ID | Module Type | TypeId | RunAs |
---|---|---|---|
DS | DataSource | System.Discovery.Scheduler | Default |
PS | ProbeAction | Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe | Default |
InstanceFilter | ConditionDetection | System.ExpressionFilter | Default |
Mapping | ConditionDetection | System.Discovery.FilteredClassSnapshotDataMapper | Default |
ID | ParameterType | Selector | Display Name | Description |
---|---|---|---|---|
IntervalSeconds | int | $Config/IntervalSeconds$ | Intervalle en secondes | À quelle fréquence (en secondes) la valeur doit être échantillonnée. |
SyncTime | string | $Config/SyncTime$ | Heure de synchronisation | Heure de synchronisation pour l'exécution du module. |
TimeoutSeconds | int | $Config/TimeoutSeconds$ | Expiration du délai (secondes) | Le délai d'attente (en secondes) jusqu'à la fin d'exécution du module. |
<DataSourceModuleType ID="Microsoft.Windows.Server.DNS.2012.R2.IsZoneSignedProperty.DS" Accessibility="Public">
<Configuration>
<IncludeSchemaTypes>
<SchemaType>System!System.Discovery.MapperSchema</SchemaType>
<SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ZoneName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ComputerName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="SyncTime" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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>
<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>DNSZoneIsSigned2012R2Probe</ScriptName>
<ScriptBody>
param ([String] $PrincipalName)
$SCRIPT_NAME = "DNSZoneIsSigned2012R2Probe"
$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 R2 Zone Is Signed Property Bag Powershell Script"
$DNSZones = Get-DnsServerZone -ComputerName $PrincipalName
if($DNSZones -ne $null)
{
if($DNSZones.Count -eq $null)
{
$ZoneCount = 1
}
else
{
$ZoneCount = $DNSZones.Count
}
for ($itmZone=0; $itmZone -lt $ZoneCount; $itmZone++)
{
if($ZoneCount -eq 1)
{
$ZoneObj = $DNSZones
}
else
{
$ZoneObj = $DNSZones.Item($itmZone)
}
if ($ZoneObj.IsAutoCreated -eq $false)
{
$PropertyBag = $momAPI.CreatePropertyBag()
$PropertyBag.AddValue("ZoneName", $ZoneObj.ZoneName)
$PropertyBag.AddValue("IsSigned", $ZoneObj.IsSigned)
$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='ZoneName']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/ZoneName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<ConditionDetection ID="Mapping" TypeID="System!System.Discovery.FilteredClassSnapshotDataMapper">
<Expression/>
<ClassId>$MPElement[Name='Microsoft.Windows.Server.DNS.Zone']$</ClassId>
<InstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$</Name>
<Value>$Config/ComputerName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name='Microsoft.Windows.Server.DNS.Server']/Name$</Name>
<Value>$Config/ComputerName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name='Microsoft.Windows.Server.DNS.Zone']/ZoneName$</Name>
<Value>$Config/ZoneName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name='Microsoft.Windows.Server.DNS.Zone']/HostName$</Name>
<Value>$Config/ComputerName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name='Microsoft.Windows.Server.DNS.Zone']/IsSigned$</Name>
<Value>$Data/Property[@Name='IsSigned']$</Value>
</Setting>
</Settings>
</InstanceSettings>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="Mapping">
<Node ID="InstanceFilter">
<Node ID="PS">
<Node ID="DS"/>
</Node>
</Node>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>