Discover File Services role containment relationship

Microsoft.Windows.FileServices.Service.iSCSITarget.10.0.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 Server 2016 and 1709+ release.

Element properties:

TargetMicrosoft.Windows.FileServices.Service.iSCSITarget.10.0
EnabledTrue
Frequency14400
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.FileServices.Service.iSCSITarget.10.0.Relationship.Discovery" Enabled="true" Target="Microsoft.Windows.FileServices.Service.iSCSITarget.10.0" 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>14400</IntervalSeconds>
<SyncTime/>
<ScriptName>iSCSI62R2.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 "iSCSI62.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.FileServices.Service.iSCSITarget.10.0']$")

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

set oInstFs = oDiscoveryData.CreateClassInstance("$MPElement[Name='FileServices63!Microsoft.Windows.FileServices.10.0.FileServer']$")
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>