Discover Supporting Server Relationship
Microsoft.MSMQ.2003.DiscoverSupportingServerRelationship (Discovery)
Discover the relationship between a dependant client and its supporting server.
Knowledge Base article: Element properties: Object Discovery Details: Member Modules:
Source Code: <Discovery ID="Microsoft.MSMQ.2003.DiscoverSupportingServerRelationship" Enabled="true" Target="Microsoft.MSMQ.2003.DependentClient" ConfirmDelivery="false" Remotable="false" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryRelationship TypeID="Microsoft.MSMQ.2003.Relationship.DependentClientContainsSupportingServer"/>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>43200</IntervalSeconds>
<SyncTime/>
<ScriptName>DiscoverSupportingServer.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$ $Target/Property[Type="MSMQ!Microsoft.MSMQ.DependentClient"]/SupportingServer$</Arguments>
<ScriptBody><Script>
option explicit
SetLocale("en-us")
Const SCRIPT_NAME = "DiscoverSupportingServer.vbs"
Dim oAPI, oDiscoveryData, oSource, oTarget, oRelationship
Dim SourceId, ManagedEntityId, TargetComputer, SupportingServer
SourceId = WScript.Arguments(0)
ManagedEntityId = WScript.Arguments(1)
TargetComputer = WScript.Arguments(2)
SupportingServer = WScript.Arguments(3)
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceId, ManagedEntityId)
Set oSource = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.MSMQ.2003.DependentClient']$")
call oSource.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
Set oTarget = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.MSMQ.2003.Server']$")
call oTarget.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", GetFQDN(SupportingServer))
Set oRelationship = oDiscoveryData.CreateRelationshipInstance("$MPElement[Name='Microsoft.MSMQ.2003.Relationship.DependentClientContainsSupportingServer']$")
oRelationship.Source = oSource
oRelationship.Target = oTarget
Call oDiscoveryData.AddInstance(oRelationship)
Call oAPI.Return(oDiscoveryData)
Function GetFQDN(ShortName)
Dim sDomain
If InStr(ShortName,".") > 0 Then
GetFQDN = ShortName
Else
sDomain = Right(TargetComputer,Len(TargetComputer)-InStr(TargetComputer,"."))
GetFQDN = ShortName & "." & sDomain
End If
End Function
</Script> </ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</Discovery>