File Classification Infrastructure Windows Server 2008 R2 Relationship Discovery

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

This object discovers the relationship between file servers and computers that are using the File Classification Infrastructure.

Knowledge Base article:

Summary

This object discovers the containment relationship between the File Services role and the File Classification Infrastructure in Windows Server 2008 R2 by using the DiscoverFCIRel.vbs script.

Element properties:

TargetMicrosoft.Windows.FileServer.2008R2
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.FileServer.Service.FCI.2008R2.Relationship.Discovery" Enabled="true" Target="FileServices2008R2!Microsoft.Windows.FileServer.2008R2" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<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>DiscoverFCIRel.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 "DiscoverFCIRel.vbs",6125,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 oWmiInst = GetObject("winmgmts:\\" &amp; TargetComputer &amp; "\ROOT\CIMV2")
Set oServerFeature = oWmiInst.ExecQuery("SELECT * FROM Win32_ServerFeature WHERE ID='104'")

if oServerFeature.Count &gt; 0 Then
set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.FileServer.Service.FCI.2008R2']$")

call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", Left(TargetComputer, InStr(TargetComputer, ".")-1))
call oDiscoveryData.AddInstance(oInst)

''
'' Since we are using "contains" - we have to now discover the class instance above us. If it is
'' already discovered, Ops Manager will recognize this as a reference count increase and not a
'' separate discovery because the key property is the same.
''

set oInstFs = oDiscoveryData.CreateClassInstance("$MPElement[Name='FileServices2008R2!Microsoft.Windows.FileServer.2008R2']$")
call oInstFs.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
call oInstFs.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", Left(TargetComputer, InStr(TargetComputer, ".")-1))
call oDiscoveryData.AddInstance(oInstFs)

''
'' Now we have to also create an instance of the relationship to link this Service instance to its parent (FileServer)
''

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

Call oAPI.Return(oDiscoveryData)



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