MsDrda Service Discovery

Microsoft.HostIntegrationServer.2016.MsDrdaServiceDiscovery (Discovery)

Discovers the MsDrda Service

Knowledge Base article:

Summary

The MsDrda Service discovery queries the WMI namespace “root\cimv2” for the “MsDrdaService”. If found, the Host Integration Server 2016 Management Pack creates an instance of the MsDrda class.

Element properties:

TargetMicrosoft.HostIntegrationServer.2016.DataInt
EnabledTrue
Frequency21600
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.TimedScript.DiscoveryProvider Default

Source Code:

<Discovery ID="Microsoft.HostIntegrationServer.2016.MsDrdaServiceDiscovery" Enabled="true" Target="Microsoft.HostIntegrationServer.2016.DataInt" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.HostIntegrationServer.2016.MsDrda">
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>21600</IntervalSeconds>
<SyncTime/>
<ScriptName>HIS2016 MsDrdaService Discovery.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Arguments>
<ScriptBody><Script>
'--------------------------------------------------------------------------------------------------
' &lt;name&gt;HIS2016 MsDrdaService Discovery.vbs&lt;/name&gt;
' &lt;company&gt;Microsoft Corporation&lt;/company&gt;
' &lt;copyright&gt;Copyright (c) Microsoft Corporation 2016&lt;/copyright&gt;
' &lt;summary&gt;
' Microsoft Host Integration Server 2016 MsDrdaService discovery script for use with SCOM 2016.
' Provides discovery functions for Host Integration Server 2016 MsDrdaService.
' &lt;/summary&gt;
'
' See Management Pack Guide for details on parameters and usage
'--------------------------------------------------------------------------------------------------
Option Explicit
SetLocale("en-us")
Dim oAPI, oDiscoveryData, oInst
Set oAPI = CreateObject("MOM.ScriptAPI")

Dim oArgs
Set oArgs = WScript.Arguments
if oArgs.Count &lt; 3 Then
Wscript.Quit -1
End If

Dim SourceID, ManagedEntityId, TargetComputer

SourceId = oArgs(0)
ManagedEntityId = oArgs(1)
TargetComputer = oArgs(2)

set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceId, ManagedEntityId)

' MS Drda Service Discovery
' Search for MsDrdaService instance of root\cimv2\Win32_Service.
' If &gt; 0, create the MsDrdaService

Dim colWin32Services
Dim objWin32Service
Dim Locator, Service

Set Locator = CreateObject("WbemScripting.SWbemLocator")

Set Service = Locator.ConnectServer(TargetComputer, "root\cimv2")

set colWin32Services = Service.ExecQuery("select * from Win32_Service where Name='MsDrdaService'",, 0)

for each objWin32Service in colWin32Services

set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.HostIntegrationServer.2016.MsDrda']$")
call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", "MsDrda Service")
call oDiscoveryData.AddInstance(oInst)

next

call oAPI.Return(oDiscoveryData)
</Script></ScriptBody>
<TimeoutSeconds>360</TimeoutSeconds>
</DataSource>
</Discovery>