AD Replication Queue Data source

Microsoft.Windows.Server.2012.R2.AD.Replication.Queue.DataSource (DataSourceModuleType)

Data source for the AD Replication Queue monitors.

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource System.CommandExecuterPropertyBagSource Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
Frequencyint$Config/Frequency$FrequencyHow often the monitor is run
TimeoutSecondsint$Config/TimeoutSeconds$TimeoutTime out in Sec
WarnThresholdint$Config/WarnThreshold$Warning ThresholdSize of replication queue that initiates a Warning
ErrorThresholdint$Config/ErrorThreshold$Error ThresholdSize of replication queue that initiates an Error
NumSamplesint$Config/NumSamples$Number of Samples

Source Code:

<DataSourceModuleType ID="Microsoft.Windows.Server.2012.R2.AD.Replication.Queue.DataSource" Accessibility="Internal" Batching="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Frequency" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WarnThreshold" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ErrorThreshold" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="NumSamples" type="xsd:int"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="Frequency" Selector="$Config/Frequency$" ParameterType="int"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
<OverrideableParameter ID="WarnThreshold" Selector="$Config/WarnThreshold$" ParameterType="int"/>
<OverrideableParameter ID="ErrorThreshold" Selector="$Config/ErrorThreshold$" ParameterType="int"/>
<OverrideableParameter ID="NumSamples" Selector="$Config/NumSamples$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="System!System.CommandExecuterPropertyBagSource">
<IntervalSeconds>$Config/Frequency$</IntervalSeconds>
<ApplicationName>%windir%\system32\cscript.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>//nologo $file/AD_Replication_Queue.vbs$</CommandLine>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>AD_Replication_Queue.vbs</Name>
<Contents><Script>'*************************************************************************
' Script Name - AD Replication Queue
'
' Purpose - Obtains the current number of items in the replication queue.
' - A UnitMonitor will leverage this data to determine if there is a problem or not.
'
' (c) Copyright 2014, Microsoft Corporation, All Rights Reserved
' Proprietary and confidential to Microsoft Corporation
'*************************************************************************

Option Explicit

SetLocale("en-us")

On Error Resume Next

Sub Main()

Dim oBag, oAPI, oWMI, oObjects

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()

Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\MicrosoftActiveDirectory")
Set oObjects = oWMI.ExecQuery("Select * from MSAD_ReplPendingOp")

oBag.AddValue "StatusInstance", ""
oBag.AddValue "StatusValue", "" &amp; CInt(oObjects.Count)

Call oAPI.Return(oBag)

End Sub

Call Main()
</Script></Contents>
</File>
</Files>
</DataSource>
</MemberModules>
<Composition>
<Node ID="DS"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>