AD Database File Disk Size Free Space (bytes) Script Data source

Microsoft.Windows.Server.2012.R2.AD.Availability.Size.DITBytes.DataSource (DataSourceModuleType)

Data source for the AD Database File Disk Free Space monitors.

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource System.CommandExecuterPropertyBagSource Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
IntervalSecondsint$Config/IntervalSeconds$Interval Seconds
TimeoutSecondsint$Config/TimeoutSeconds$Timeout Seconds

Source Code:

<DataSourceModuleType ID="Microsoft.Windows.Server.2012.R2.AD.Availability.Size.DITBytes.DataSource" Accessibility="Public" Batching="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IntervalSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:int"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="System!System.CommandExecuterPropertyBagSource">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<ApplicationName>%windir%\system32\cscript.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>//nologo $file/DIT_Size.vbs$</CommandLine>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>DIT_Size.vbs</Name>
<Contents><Script>'*************************************************************************
' Script Name - DIT Size
'
' Purpose - Gets the current size of the ntds.dit file
'
' (c) Copyright 2014, Microsoft Corporation, All Rights Reserved
' Proprietary and confidential to Microsoft Corporation
'*************************************************************************

Option Explicit

SetLocale("en-us")

' TypedPropertyBag
const PerformanceDataType = 2

' Location of the DIT file
const DatabaseRegKey = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters\DSA Database File"

Sub Main()
Dim sPathDB, oAPI, oPerfBag
Dim oReg, oFileSystem

Set oAPI = CreateObject("Mom.ScriptAPI")
Set oPerfBag = oAPI.CreateTypedPropertyBag(PerformanceDataType)

On Error Resume Next

Set oReg = CreateObject("WScript.Shell")
Set oFileSystem = CreateObject("Scripting.FileSystemObject")

' Read the path to the database file from the registry
sPathDB = oReg.RegRead(DatabaseRegKey)

oPerfBag.AddValue "StatusCounter" , "Database Size"
oPerfBag.AddValue "StatusInstance" , sPathDB
oPerfBag.AddValue "StatusValue", "" &amp; oFileSystem.GetFile(sPathDB).Size
oAPI.AddItem oPerfBag

oAPI.ReturnItems
End Sub

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