Microsoft.Exchange.2010.UnifiedMessagingComponent.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.UnifiedMessagingComponent.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/MicrosoftExchangeUnifiedMessagingComponentDiscovery.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$" $Config/IsDatacenter$ "$Config/VerboseLogging$"</CommandLine>
<TimeoutSeconds>900</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>MicrosoftExchangeUnifiedMessagingComponentDiscovery.js</Name>
<Contents><Script>
// ----------------------------------------------------------------------
// Script to discover UnifiedMessagingComponent entities.
// ----------------------------------------------------------------------

var EXPECTED_ARGUMENT_COUNT = 8;
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 = "MicrosoftExchangeUnifiedMessagingComponentDiscovery.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 isDatacenterString = WScript.Arguments(6);
var verboseLoggingString = WScript.Arguments(7);

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

var infoOutput = " UnifiedMessagingComponent 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);

// ----------------------------------------------------------------------
// Instantiate UnifiedMessagingComponent classes.
// ----------------------------------------------------------------------
//
// Construct the UnifiedMessagingRole class's Name key property.
var unifiedMessagingRoleName = computerNetbiosName + " (Unified Messaging) - " + computerActiveDirectorySite;

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

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

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

// Availability classes
var oUMAvailabilityService = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessaging.Availability.Service']$");
oUMAvailabilityService.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oUMAvailabilityService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", unifiedMessagingRoleName);
oUMAvailabilityService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Service Availability - " + unifiedMessagingRoleName);
discoveryData.AddInstance(oUMAvailabilityService);

var oUMAvailabilityGateway = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessaging.Availability.Gateway']$");
oUMAvailabilityGateway .AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oUMAvailabilityGateway .AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", unifiedMessagingRoleName);
oUMAvailabilityGateway .AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Gateway Availability - " + unifiedMessagingRoleName);
discoveryData.AddInstance(oUMAvailabilityGateway);

// GeneralSensor classes
oUMMailboxFailures = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessaging.GeneralSensor.MailboxFailures']$");
oUMMailboxFailures.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oUMMailboxFailures.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", unifiedMessagingRoleName);
oUMMailboxFailures.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "General Sensors - Mailbox Failures - " + unifiedMessagingRoleName);
discoveryData.AddInstance(oUMMailboxFailures);

// SubComponent classes
oUMSubComponentPartnerTranscriptionFailures = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessaging.SubComponent.PartnerTranscriptionFailures']$");
oUMSubComponentPartnerTranscriptionFailures.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oUMSubComponentPartnerTranscriptionFailures.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", unifiedMessagingRoleName);
oUMSubComponentPartnerTranscriptionFailures.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "SubComponent - Partner Voice Message Transcription Failures - " + unifiedMessagingRoleName);
discoveryData.AddInstance(oUMSubComponentPartnerTranscriptionFailures);

oUMSubComponentPipeline = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessaging.SubComponent.Pipeline']$");
oUMSubComponentPipeline.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oUMSubComponentPipeline.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", unifiedMessagingRoleName);
oUMSubComponentPipeline.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "SubComponent - Pipeline " + unifiedMessagingRoleName);
discoveryData.AddInstance(oUMSubComponentPipeline);

oUMSubComponentProtectedVoiceMail = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessaging.SubComponent.ProtectedVoiceMessage']$");
oUMSubComponentProtectedVoiceMail.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oUMSubComponentProtectedVoiceMail.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", unifiedMessagingRoleName);
oUMSubComponentProtectedVoiceMail.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "SubComponent - Protected Voice Message - " + unifiedMessagingRoleName);
discoveryData.AddInstance(oUMSubComponentProtectedVoiceMail);

// Telephony classes
oUMTelephonyInbound = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessaging.Telephony.Inbound']$");
oUMTelephonyInbound.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oUMTelephonyInbound.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", unifiedMessagingRoleName);
oUMTelephonyInbound.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Telephony - Inbound - " + unifiedMessagingRoleName);
discoveryData.AddInstance(oUMTelephonyInbound);

oUMTelephonyOutbound = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessaging.Telephony.Outbound']$");
oUMTelephonyOutbound.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oUMTelephonyOutbound.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", unifiedMessagingRoleName);
oUMTelephonyOutbound.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Telephony - Outbound - " + unifiedMessagingRoleName);
discoveryData.AddInstance(oUMTelephonyOutbound);


// ----------------------------------------------------------------------
// Instantiate CommonComponent classes hosted by UnifiedMessagingRole.
// ----------------------------------------------------------------------
//
// Construct the CommonRole class's Name key property.
var commonRoleName = computerNetbiosName + " (Common) - " + computerActiveDirectorySite;

// 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 CommonFileDistributionService instance.
var oCommonFds = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonFileDistributionService']$");
oCommonFds.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonFds.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonFds.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Common FDS - " + commonRoleName);
discoveryData.AddInstance(oCommonFds);

// 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 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 CommonTransportThrottlingClient instance.
var oCommonTransportThrottlingClient = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.CommonTransportThrottlingClient']$");
oCommonTransportThrottlingClient.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", computerPrincipalName);
oCommonTransportThrottlingClient.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.ServerRole']/RoleName$", commonRoleName);
oCommonTransportThrottlingClient.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Component']/ComponentName$", "Transport Throttling Client - " + commonRoleName);
discoveryData.AddInstance(oCommonTransportThrottlingClient);

// 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);

// ----------------------------------------------------------------------
// Instantiate org level service classes related to UnifiedMessagingComponent.
// ----------------------------------------------------------------------
//
// Create the UnifiedMessagingService instance.
var oUMService = discoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessagingService']$");
oUMService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/ServiceName$", "Unified Messaging Service - " + computerActiveDirectorySite);
oUMService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/InstanceName$", computerActiveDirectorySite);
oUMService.AddProperty("$MPElement[Name='Microsoft.Exchange.2010.Service']/ActiveDirectorySite$", computerActiveDirectorySite);
discoveryData.AddInstance(oUMService);


// ----------------------------------------------------------------------
// 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 UnifiedMessagingComponent.
// ----------------------------------------------------------------------
//
// Create containment relationship from UnifiedMessagingService to UM.
var oUMServiceContainsUMAvailabilityService = discoveryData.CreateRelationshipInstance("$MPElement[Name='Microsoft.Exchange.2010.UnifiedMessagingService.Contains.Microsoft.Exchange.2010.UnifiedMessaging.Availability.Service']$");
oUMServiceContainsUMAvailabilityService.Source = oUMService;
oUMServiceContainsUMAvailabilityService.Target = oUMAvailabilityService;
discoveryData.AddInstance(oUMServiceContainsUMAvailabilityService);

// ----------------------------------------------------------------------
// 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>