探索檔案服務角色內含項目關聯性
Microsoft.Windows.FileServices.Service.iSCSITarget.6.3.Relationship.Discovery (Discovery)
探索檔案服務角色和在此伺服器上探索到的 iSCSI 目標物件之間的內含項目關聯性
Knowledge Base article: Element properties: Object Discovery Details: Member Modules:
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 < 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>