探索檔案服務角色內含項目關聯性

Microsoft.Windows.FileServices.Service.iSCSITarget.6.3.Relationship.Discovery (Discovery)

探索檔案服務角色和在此伺服器上探索到的 iSCSI 目標物件之間的內含項目關聯性

Knowledge Base article:

摘要

此探索規則會在檔案服務角色和 iSCSI 目標服務 (若存在) 之間探索內含項目關聯性。此規則會針對 iSCSI 目標服務執行,且只會在已探索 iSCSI 目標服務之後執行。 iSCSI 目標服務會隨附於 Windows Server 2012 R2 發行版本。

Element properties:

TargetMicrosoft.Windows.FileServices.Service.iSCSITarget.6.3
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.6.3.Relationship.Discovery" Enabled="true" Target="Microsoft.Windows.FileServices.Service.iSCSITarget.6.3" 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.6.3']$")

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

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