MsDrda Service Discovery
Microsoft.HostIntegrationServer.2016.MsDrdaServiceDiscovery (Discovery)
Discovers the MsDrda Service
Knowledge Base article: Element properties: Object Discovery Details: Member Modules:
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>
'--------------------------------------------------------------------------------------------------
' <name>HIS2016 MsDrdaService Discovery.vbs</name>
' <company>Microsoft Corporation</company>
' <copyright>Copyright (c) Microsoft Corporation 2016</copyright>
' <summary>
' Microsoft Host Integration Server 2016 MsDrdaService discovery script for use with SCOM 2016.
' Provides discovery functions for Host Integration Server 2016 MsDrdaService.
' </summary>
'
' 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 < 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 > 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>