Microsoft.Exchange.2010.MailboxComponent.DiscoveryDataSource (DataSourceModuleType)

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
OutputTypeSystem.Discovery.Data

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource System.CommandExecuterDiscoveryDataSource Default

Overrideable Parameters:

IDParameterTypeSelector
IntervalSecondsint$Config/IntervalSeconds$
IsDatacenterbool$Config/IsDatacenter$
VerboseLoggingbool$Config/VerboseLogging$

Source Code:

<DataSourceModuleType ID="Microsoft.Exchange.2010.MailboxComponent.DiscoveryDataSource" Accessibility="Internal" Batching="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IsDatacenter" type="xsd:boolean"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="VerboseLogging" type="xsd:boolean"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="IsDatacenter" Selector="$Config/IsDatacenter$" ParameterType="bool"/>
<OverrideableParameter ID="VerboseLogging" Selector="$Config/VerboseLogging$" ParameterType="bool"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="System!System.CommandExecuterDiscoveryDataSource">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<ApplicationName>%windir%\System32\cscript.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>//Nologo $file/MicrosoftExchangeMailboxComponentDiscovery.js$ 0 $MPElement$ $Target/Id$ $Target/Host/Property[Type='Windows!Microsoft.Windows.Computer']/PrincipalName$ "$Target/Host/Property[Type='Windows!Microsoft.Windows.Computer']/NetbiosComputerName$" "$Target/Host/Property[Type='Windows!Microsoft.Windows.Computer']/ActiveDirectorySite$" "$Target/Property[Type='Microsoft.Exchange.2010.MailboxRole']/IsVirtualServer$" $Config/IsDatacenter$ "$Config/VerboseLogging$"</CommandLine>
<TimeoutSeconds>900</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>MicrosoftExchangeMailboxComponentDiscovery.js</Name>
<Contents><Script>
// ----------------------------------------------------------------------
// Script to discover MailboxComponent entities.
// ----------------------------------------------------------------------

var EXPECTED_ARGUMENT_COUNT = 9;
var UNEXPECTED_ARGUMENT_COUNT_ERROR_ID = 101;

var DISCOVERY_STARTED_INF_ID = 1470;
var DISCOVERY_ENDED_INF_ID = 1471;
var DISCOVERY_PROGRESS_INF_ID = 1472;

var EVENT_SOURCE = "MicrosoftExchangeMailboxComponentDiscovery.js";
var EVENT_TYPE_ERROR = 1;
var EVENT_TYPE_WARNING = 2;
var EVENT_TYPE_INFORMATION = 4;

var oAPI = new ActiveXObject("Mom.ScriptAPI");

var argumentsStr = "";
for (var i = 0; i &lt; WScript.Arguments.length; i++)
{
argumentsStr = argumentsStr.concat("\"", WScript.Arguments(i), "\" ");
}

if (WScript.Arguments.length != EXPECTED_ARGUMENT_COUNT)
{
oAPI.LogScriptEvent(
EVENT_SOURCE,
UNEXPECTED_ARGUMENT_COUNT_ERROR_ID,
EVENT_TYPE_ERROR,
"Expected " + EXPECTED_ARGUMENT_COUNT + " arguments. But there were " + WScript.Arguments.length + " arguments. Exiting script.\n Arguments: " + argumentsStr);

WScript.Quit(-1);
}

var sourceType = WScript.Arguments(0);
var sourceId = WScript.Arguments(1);
var managedEntityId = WScript.Arguments(2);
var computerPrincipalName = WScript.Arguments(3);
var computerNetbiosName = WScript.Arguments(4);
var computerActiveDirectorySite = WScript.Arguments(5);
var isVirtualServerString = WScript.Arguments(6); // For MailboxRole, this should always have value of either "true" or "false"
var isDatacenterString = WScript.Arguments(7); // Should have value of either "true" or "false".
var verboseLoggingString = WScript.Arguments(8);

// Convert variables from string to bool.
var isVirtualServer = (isVirtualServerString.toLowerCase() == "true") ? true : false;
var isDatacenter = (isDatacenterString.toLowerCase() == "true") ? true : false;
var verboseLogging = (verboseLoggingString.toLowerCase() == "true") ? true : false;

var infoOutput = "MailboxComponent Discovery script \n"
+ " Message: ";

main();

function main()
{
LogEvent(DISCOVERY_STARTED_INF_ID, EVENT_TYPE_INFORMATION, infoOutput + "Discovery Script started.\n Arguments: " + argumentsStr);

var discoveryData = oAPI.CreateDiscoveryData(sourceType, sourceId, managedEntityId);

// Construct the MailboxRole class's Name key property.
var mailboxRoleName = computerNetbiosName + " (Mailbox) - " + computerActiveDirectorySite;

// Construct the CommonRole class's Name key property.
var commonRoleName = computerNetbiosName + " (Common) - " + computerActiveDirectorySite;

// ----------------------------------------------------------------------
// Instantiate CommonComponent classes hosted by all MailboxRole types.
// ----------------------------------------------------------------------
//
// Create the CommonAllServerRoles instance.
var oCommonAllServerRoles = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonAllServerRoles']$");
oCommonAllServerRoles.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonAllServerRoles.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonAllServerRoles.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Server - " + commonRoleName);
discoveryData.AddInstance(oCommonAllServerRoles);

// Create the CommonBestPracticeAnalyzer instance.
var oCommonBpa = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonBestPracticeAnalyzer']$");
oCommonBpa.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonBpa.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonBpa.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "ExBPA - " + commonRoleName);
discoveryData.AddInstance(oCommonBpa);

// Create the CommonProblemAnalysis instance.
var oCommonProblemAnalysis = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonProblemAnalysis']$");
oCommonProblemAnalysis.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonProblemAnalysis.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonProblemAnalysis.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Watson Events - " + commonRoleName);
discoveryData.AddInstance(oCommonProblemAnalysis);

// Create the CommonServer instance.
var oCommonServer = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonServer']$");
oCommonServer.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonServer.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonServer.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Disk - " + commonRoleName);
discoveryData.AddInstance(oCommonServer);

// Create the CommonServiceMonitoring instance.
var oCommonServiceMonitoring = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonServiceMonitoring']$");
oCommonServiceMonitoring.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonServiceMonitoring.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonServiceMonitoring.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Common Services - " + commonRoleName);
discoveryData.AddInstance(oCommonServiceMonitoring);

// Create the CommonInternalRoleServices instance.
var oCommonInternalRoleServices = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonInternalRoleServices']$");
oCommonInternalRoleServices.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonInternalRoleServices.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonInternalRoleServices.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Common Services for Internal Roles - " + commonRoleName);
discoveryData.AddInstance(oCommonInternalRoleServices);

// Create the CommonMSExchangeRPCServiceMonitoring instance.
var oCommonMSExchangeRPCServiceMonitoring = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonMSExchangeRPCServiceMonitoring']$");
oCommonMSExchangeRPCServiceMonitoring.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonMSExchangeRPCServiceMonitoring.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonMSExchangeRPCServiceMonitoring.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "MSExchange RPC service - " + commonRoleName);
discoveryData.AddInstance(oCommonMSExchangeRPCServiceMonitoring);

// Create the CommonRemotePowerShell instance.
var oCommonRemotePowerShell = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonRemotePowerShell']$");
oCommonRemotePowerShell.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonRemotePowerShell.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonRemotePowerShell.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Remote PowerShell - " + commonRoleName);
discoveryData.AddInstance(oCommonRemotePowerShell);

// Create the Auditing instance.
var oCommonAuditing = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.Auditing']$");
oCommonAuditing.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonAuditing.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonAuditing.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Auditing - " + commonRoleName);
discoveryData.AddInstance(oCommonAuditing);

// Create the CommonConfigurationAuthorization instance.
var oCommonConfigurationAuthorization = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonConfigurationAuthorization']$");
oCommonConfigurationAuthorization.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonConfigurationAuthorization.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonConfigurationAuthorization.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Configuration Authorization - " + commonRoleName);
discoveryData.AddInstance(oCommonConfigurationAuthorization);

// Create the CommonProvisioningBroker instance.
var oCommonProvisioningBroker = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonProvisioningBroker']$");
oCommonProvisioningBroker.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonProvisioningBroker.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonProvisioningBroker.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Provisioning Broker - " + commonRoleName);
discoveryData.AddInstance(oCommonProvisioningBroker);

// Create the CommonTransportLogSearch instance.
var oCommonTransportLogSearch = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonTransportLogSearch']$");
oCommonTransportLogSearch.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonTransportLogSearch.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonTransportLogSearch.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Transport Log Search - " + commonRoleName);
discoveryData.AddInstance(oCommonTransportLogSearch);


// ----------------------------------------------------------------------
// Instantiate MailboxComponent and CommonComponent classes and
// relationships for mailbox servers.
// ----------------------------------------------------------------------
//
// Create the Mailbox.MailboxMonitoring instance.
var oMbxMailboxMonitoring = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.Mailbox.MailboxMonitoring']$");
oMbxMailboxMonitoring.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oMbxMailboxMonitoring.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", mailboxRoleName);
oMbxMailboxMonitoring.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Mailbox Monitoring - " + mailboxRoleName);
discoveryData.AddInstance(oMbxMailboxMonitoring);

// Create the Mailbox.ServiceMonitoring instance.
var oMbxServiceMonitoring = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.Mailbox.ServiceMonitoring']$");
oMbxServiceMonitoring.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oMbxServiceMonitoring.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", mailboxRoleName);
oMbxServiceMonitoring.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Services - " + mailboxRoleName);
discoveryData.AddInstance(oMbxServiceMonitoring);

// Create the MailboxSystemAttendant instance.
var oMbxSA = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.MailboxSystemAttendant']$");
oMbxSA.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oMbxSA.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", mailboxRoleName);
oMbxSA.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "SA - " + mailboxRoleName);
discoveryData.AddInstance(oMbxSA);

// Create the CommonExtensibleStorageEngine instance (for Mailbox servers excluding physical cluster nodes).
var oCommonEse = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonExtensibleStorageEngine']$");
oCommonEse.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonEse.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonEse.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "ESE - " + commonRoleName);
discoveryData.AddInstance(oCommonEse);

// Create the UnifiedMessagingService instance.
var oUnifiedMessagingService = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessagingService']$");
oUnifiedMessagingService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/ServiceName$", "Unified Messaging Service - " + computerActiveDirectorySite);
oUnifiedMessagingService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/InstanceName$", computerActiveDirectorySite);
oUnifiedMessagingService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/ActiveDirectorySite$", computerActiveDirectorySite);
discoveryData.AddInstance(oUnifiedMessagingService);

// Create the UnifiedMessagingWithoutCorrelation instance.
var oUnifiedMessagingWithoutCorrelation = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessaging.WithoutCorrelation']$");
oUnifiedMessagingWithoutCorrelation.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oUnifiedMessagingWithoutCorrelation.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oUnifiedMessagingWithoutCorrelation.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Unified Messaging Uncorrelated Alerts - " + commonRoleName);
discoveryData.AddInstance(oUnifiedMessagingWithoutCorrelation );

// Create the MailboxTransportThrottlingServer instance.
var oMbxTransportThrottlingServer = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.MailboxTransportThrottlingServer']$");
oMbxTransportThrottlingServer.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oMbxTransportThrottlingServer.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", mailboxRoleName);
oMbxTransportThrottlingServer.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Transport Throttling Server - " + mailboxRoleName);
discoveryData.AddInstance(oMbxTransportThrottlingServer);

// ----------------------------------------------------------------------
// Instantiate org level service classes related to MailboxComponent.
// ----------------------------------------------------------------------
//
// Create the MapiService instance.
var oMapiService = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.MailboxMapiService']$");
oMapiService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/ServiceName$", "MAPI Service - " + computerActiveDirectorySite);
oMapiService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/InstanceName$", computerActiveDirectorySite);
oMapiService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/ActiveDirectorySite$", computerActiveDirectorySite);
discoveryData.AddInstance(oMapiService);

// ----------------------------------------------------------------------
// Instantiate org level service classes related to CommonComponent.
// ----------------------------------------------------------------------
//
// Create the CommonRemotePowerShellService instance.
var oCommonRemotePowerShellService = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonRemotePowerShellService']$");
oCommonRemotePowerShellService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/ServiceName$", "Remote PowerShell Service - " + computerActiveDirectorySite);
oCommonRemotePowerShellService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/InstanceName$", computerActiveDirectorySite);
oCommonRemotePowerShellService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/ActiveDirectorySite$", computerActiveDirectorySite);
discoveryData.AddInstance(oCommonRemotePowerShellService);

// ----------------------------------------------------------------------
// Create relationships from org level services to MailboxComponent.
// ----------------------------------------------------------------------
//
// Create containment relationship from MapiService to Mailbox.MailboxMonitoring.
var oMapiServiceServiceContainsMbxMailboxMonitoring = discoveryData.CreateRelationshipInstance("$MPElement[Name='Microsoft.Exchange.2010.MailboxMapiService.Contains.Microsoft.Exchange.2010.Mailbox.MailboxMonitoring']$");
oMapiServiceServiceContainsMbxMailboxMonitoring.Source = oMapiService;
oMapiServiceServiceContainsMbxMailboxMonitoring.Target = oMbxMailboxMonitoring;
discoveryData.AddInstance(oMapiServiceServiceContainsMbxMailboxMonitoring);

// ----------------------------------------------------------------------
// Create relationships from org level services to CommonComponent.
// ----------------------------------------------------------------------
//
if (false == isDatacenter)
{
// Create containment relationship from CommonRemotePowerShellService to CommonRemotePowerShell only when Datacenter management pack is not installed.
var oCommonRemotePowerShellServiceContainsCommonRemotePowerShell = discoveryData.CreateRelationshipInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonRemotePowerShellService.Contains.Microsoft.Exchange.2010.CommonRemotePowerShell']$");
oCommonRemotePowerShellServiceContainsCommonRemotePowerShell.Source = oCommonRemotePowerShellService;
oCommonRemotePowerShellServiceContainsCommonRemotePowerShell.Target = oCommonRemotePowerShell;
discoveryData.AddInstance(oCommonRemotePowerShellServiceContainsCommonRemotePowerShell);
}

oAPI.Return(discoveryData);

LogEvent(DISCOVERY_ENDED_INF_ID, EVENT_TYPE_INFORMATION, infoOutput + "Exiting Discovery." );
}

//
// Log to EventLog if verboseLogging is set
//
function LogEvent(eventId, eventType, message)
{
if (verboseLogging)
{
oAPI.LogScriptEvent(EVENT_SOURCE, eventId, eventType, message);
}
}
</Script></Contents>
</File>
</Files>
</DataSource>
</MemberModules>
<Composition>
<Node ID="DS"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>