This rule creates a relationship between the File Services Role for Windows Server 2012 R2 class and the DFS Namespaces Role Service (Windows Server 2012 R2) class. It does so by running the DFSN63FileServerRoleDiscovery.vbs script.
This rule creates a relationship between the File Services Role for Windows Server 2012 R2 class and the DFS Namespaces Role Service (Windows Server 2012 R2) class.
Users with Author or Administrator permissions in Operations Manager can use overrides to change the following parameters:
IntervalSeconds controls how often Operations Manager runs the discovery process.
Timeoutseconds controls how long to wait for discovery to complete.
Target | Microsoft.Windows.FileServices.6.3.FileServer |
Enabled | True |
Frequency | 43200 |
Remotable | False |
Discovered Classes and their attribuets: |
---|
Discovered relationships and their attribuets: |
ID | Module Type | TypeId | RunAs |
---|---|---|---|
DS | DataSource | Microsoft.Windows.TimedScript.DiscoveryProvider | Microsoft.Windows.FileServer.DFSN.NamespaceDiscoveryAccount |
<Discovery ID="Microsoft.Windows.FileServer.DFSN.6.3.FileServerRelationDiscovery" Enabled="true" Target="FileServices63!Microsoft.Windows.FileServices.6.3.FileServer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.Windows.FileServer.DFSN.6.3.RoleService"/>
<DiscoveryRelationship TypeID="FileServices!Microsoft.Windows.FileServer.Contains.Service"/>
</DiscoveryTypes>
<DataSource ID="DS" RunAs="DFSNLib!Microsoft.Windows.FileServer.DFSN.NamespaceDiscoveryAccount" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>43200</IntervalSeconds>
<SyncTime/>
<ScriptName>DFSN63FileServerRoleDiscovery.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$ $Target/Property[Type="FileServices!Microsoft.Windows.FileServer"]/IsOnVirtualNode$</Arguments>
<ScriptBody> Option Explicit
On Error Resume Next
SetLocale("en-us")
Dim oAPI, oArgs
Set oAPI = CreateObject("MOM.ScriptAPI")
If Err.Number <> 0 Then
Wscript.Quit -1
End if
Set oArgs = WScript.Arguments
if oArgs.Count < 3 Then
Wscript.Quit -1
End If
Dim SourceID, ManagedEntityId, TargetComputer, IsVirtualNode
SourceId = oArgs(0)
ManagedEntityId = oArgs(1)
TargetComputer = oArgs(2)
IsVirtualNode = "false"
if oArgs.Count > 3 Then
IsVirtualNode = oArgs(3)
End If
Dim oDiscoveryData, oInst, oRel, OInstFs
set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceId, ManagedEntityId)
If Err.Number <> 0 Then
Wscript.Quit -1
End if
Dim oWmiInst, oDfsService
Set oWmiInst = GetObject("winmgmts:\\" & TargetComputer & "\ROOT\CIMV2")
If Err.Number <> 0 Then
Wscript.Quit -1
End if
Set oDfsService = oWmiInst.ExecQuery("SELECT * FROM Win32_Service WHERE Name='dfs'")
if oDfsService.Count > 0 Then
set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.FileServer.DFSN.6.3.RoleService']$")
call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
if (oArgs.Count > 3) then
call oInst.AddProperty("$MPElement[Name='DFSNLib!Microsoft.Windows.FileServer.DFSN.RoleService']/IsOnVirtualNode$", IsVirtualNode)
End If
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='FileServices63!Microsoft.Windows.FileServices.6.3.FileServer']$")
call oInstFs.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
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) </ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</Discovery>