Discover File Services role containment relationship

Microsoft.Windows.FileServer.Service.iSCSITarget.2008R2.Relationship.Discovery (Discovery)

Discovers the containment relationship between the File Services role and the iSCSI Target object discovered on this server

Knowledge Base article:

Summary

This discovery rule discovers a containment relationship between the File Services role and the iSCSI Target service if it exists. The rule is targeted to the iSCSI Target service and will only run once the iSCSI Target service has been discovered. The iSCSI Target service is shipped as part of the Windows Storage Server 2008 R2 release.

Element properties:

TargetMicrosoft.Windows.FileServer.Service.iSCSITarget.2008R2
EnabledTrue
Frequency14500
RemotableFalse

Object Discovery Details:

Discovered relationships and their attribuets:

Member Modules:

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

Source Code:

<Discovery ID="Microsoft.Windows.FileServer.Service.iSCSITarget.2008R2.Relationship.Discovery" Enabled="true" Target="Microsoft.Windows.FileServer.Service.iSCSITarget.2008R2" Remotable="true">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryRelationship TypeID="FileServices!Microsoft.Windows.FileServer.Contains.Service"/>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>14500</IntervalSeconds>
<SyncTime/>
<ScriptName>iSCSI2008R2.DiscoverRelationship.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Arguments>
<ScriptBody><Script>

Option Explicit
SetLocale("en-us")

Dim oAPI, oArgs
Set oAPI = CreateObject("MOM.ScriptAPI")

Set oArgs = WScript.Arguments
if oArgs.Count &lt; 3 Then
oApi.LogScriptEvent "iSCSI2008R2.DiscoverRelationship",1,4,"Not enough arguments"
Wscript.Quit -1
End If

Dim SourceID, ManagedEntityId, TargetComputer, IsVirtualNode

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

Dim oDiscoveryData, oInst, oRel, OInstFs

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

Dim oWmiInst, oServerFeature

set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.FileServer.Service.iSCSITarget.2008R2']$")

call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)

set oInstFs = oDiscoveryData.CreateClassInstance("$MPElement[Name='FileServicesR2!Microsoft.Windows.FileServer.2008R2']$")
call oInstFs.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)

Set oRel = oDiscoveryData.CreateRelationshipInstance("$MPElement[Name='FileServices!Microsoft.Windows.FileServer.Contains.Service']$")
oRel.Source = oInstFs
oRel.Target = oInst
Call oDiscoveryData.AddInstance(oRel)


Call oAPI.Return(oDiscoveryData)


</Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</Discovery>