DFS Çoğaltma Hizmeti Yapılandırması Keşfi (Windows Server 2012 R2)

Microsoft.Windows.FileServer.DFSR.6.3.ServiceDiscovery (Discovery)

Bu nesne, Windows Server 2012 R2 çalıştıran bilgisayarlarda DFS Çoğaltma hizmeti için yapılandırma bilgilerini keşfeder.

Knowledge Base article:

Özet

Bu nesne, Windows Server 2012 R2 çalıştıran bilgisayarlarda DFS Çoğaltma hizmeti için yapılandırma bilgilerini keşfeder. Bunu yapmak için DFSRServiceDiscovery63.vbs betiğini çalıştırır ve bu betik DfsrMachineConfig WMI sınıfını aşağıdakileri de içeren yapılandırma ayarları açısından sorgular:

Yapılandırma

Operations Manager'da Yazar veya Yönetici izinlerine sahip kullanıcılar geçersiz kılmayı kullanarak aşağıdaki parametreleri değiştirebilirler:

Ek

Element properties:

TargetMicrosoft.Windows.FileServer.DFSR.6.3.Service
EnabledTrue
Frequency14400
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:
Discovered relationships and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
Microsoft.Windows.TimedScript.DiscoveryProvider DataSource Microsoft.Windows.TimedScript.DiscoveryProvider Microsoft.Windows.FileServer.DFSR.MonitoringAccount

Source Code:

<Discovery ID="Microsoft.Windows.FileServer.DFSR.6.3.ServiceDiscovery" Enabled="true" Target="Microsoft.Windows.FileServer.DFSR.6.3.Service" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.Windows.FileServer.DFSR.6.3.Service">
<Property TypeID="DFSRLib!Microsoft.Windows.FileServer.DFSR.Service" PropertyID="State"/>
<Property TypeID="DFSRLib!Microsoft.Windows.FileServer.DFSR.Service" PropertyID="DebugLogFilePath"/>
<Property TypeID="DFSRLib!Microsoft.Windows.FileServer.DFSR.Service" PropertyID="ConflictHighWatermarkPercent"/>
<Property TypeID="DFSRLib!Microsoft.Windows.FileServer.DFSR.Service" PropertyID="ConflictLowWatermarkPercent"/>
<Property TypeID="DFSRLib!Microsoft.Windows.FileServer.DFSR.Service" PropertyID="StagingHighWatermarkPercent"/>
<Property TypeID="DFSRLib!Microsoft.Windows.FileServer.DFSR.Service" PropertyID="StagingLowWatermarkPercent"/>
<Property TypeID="DFSRLib!Microsoft.Windows.FileServer.DFSR.Service" PropertyID="IsRoDriverLoaded"/>
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
<Property TypeID="DFSRLib!Microsoft.Windows.FileServer.DFSR.Service" PropertyID="IsVirtualNode"/>
</DiscoveryClass>
<DiscoveryClass TypeID="Microsoft.Windows.FileServer.DFSR.6.3.RoleService">
<Property TypeID="Microsoft.Windows.FileServer.DFSR.6.3.RoleService" PropertyID="IsVirtualNode"/>
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
</DiscoveryClass>
<DiscoveryClass TypeID="Microsoft.Windows.FileServer.DFSR.6.3.ReadOnlyFilterDriver">
<Property TypeID="Microsoft.Windows.FileServer.DFSR.6.3.ReadOnlyFilterDriver" PropertyID="DriverLoaded"/>
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
</DiscoveryClass>
<DiscoveryClass TypeID="FileServices63!Microsoft.Windows.FileServices.6.3.FileServer">
<Property TypeID="FileServices!Microsoft.Windows.FileServer" PropertyID="IsOnVirtualNode"/>
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
</DiscoveryClass>
<DiscoveryRelationship TypeID="Microsoft.Windows.FileServer.DFSR.6.3.RoleServiceContainsService"/>
<DiscoveryRelationship TypeID="DFSRLib!Microsoft.Windows.FileServer.DFSR.Service.Contains.ServerExtensions"/>
<DiscoveryRelationship TypeID="FileServices!Microsoft.Windows.FileServer.Contains.Service"/>
</DiscoveryTypes>
<DataSource ID="Microsoft.Windows.TimedScript.DiscoveryProvider" RunAs="DFSRLib!Microsoft.Windows.FileServer.DFSR.MonitoringAccount" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>14400</IntervalSeconds>
<SyncTime/>
<ScriptName>DFSRServiceDiscovery63.vbs</ScriptName>
<Arguments>0 $MPElement$ $Target/Id$ $Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$ $Target/Property[Type="DFSRLib!Microsoft.Windows.FileServer.DFSR.Service"]/IsVirtualNode$</Arguments>
<ScriptBody><Script>Option Explicit

On Error Resume Next

Dim SourceType, SourceID, ManagedEntityId, oArgs, oAPI, sDfsrServerName, isVirtualNode, isRoDriverLoaded

SetLocale("en-us")

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oArgs = WScript.Arguments

if oArgs.Count &lt; 4 Then
call oAPI.LogScriptEvent("DFSRServiceDiscovery63.vbs", 100, 1, "Expected 4 or 5 arguments. There were only " &amp; oArgs.Count &amp; " arguments. Exiting script.")
Wscript.Quit -1
End If

Dim oDiscData, oDfsService, oServiceConfig, oDfsrInfo, StateStr, oServiceConfigCollection, oDfsrInfoCollection, oDfsrConfig, oDfsrConfigCollection
Dim CurrentTime, colItems, objItem, numUptMins, numUptHour, strMsg, numUptime, serviceState

SourceType = oArgs(0)
SourceId = oArgs(1)
ManagedEntityId = oArgs(2)
sDfsrServerName = oArgs(3)

if oArgs.Count = 5 then
isVirtualNode = oArgs(4)
else
isVirtualNode = "False"
end if

isRoDriverLoaded = "False"

serviceState = "NOT KNOWN"

set oDiscData = oAPI.CreateDiscoveryData(SourceType, SourceId, ManagedEntityId)

Dim oDfsrSvc, oSvcCollection, objWMIService, oServiceWMI

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &amp; sDfsrServerName &amp; "\root\cimv2")
if Err.Number &lt;&gt; 0 then
strErr = "Unable to connect to local cimv2 WMI provider. Error: 0x" &amp; Hex(Err.Number) &amp; " " &amp; Err.Description
WScript.Echo strErr
Wscript.Quit -1
End If

Set oSvcCollection = objWMIService.ExecQuery ("Select State from Win32_service Where Name = 'DFSR'")
if Err.Number &lt;&gt; 0 then
strErr = "Unable to query Win32_service from local cimv2 WMI provider. Error: 0x" &amp; Hex(Err.Number) &amp; " " &amp; Err.Description
WScript.Echo strErr
Wscript.Quit -1
End If

set oDfsService = oDiscData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.FileServer.DFSR.6.3.Service']$")

call oDfsService.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", sDfsrServerName)
call oDfsService.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", Left(sDfsrServerName, InStr(sDfsrServerName, ".")-1))
if (oArgs.Count = 5) then
call oDfsService.AddProperty("$MPElement[Name='DFSRLib!Microsoft.Windows.FileServer.DFSR.Service']/IsVirtualNode$", isVirtualNode)
End If
Dim objShell, objScriptExec

Set objShell = CreateObject("WScript.Shell")

Set objScriptExec = objShell.Exec("sc " &amp; "\\" &amp; sDfsrServerName &amp; " query dfsrro")

Do While objScriptExec.StdOut.AtEndOfStream &lt;&gt; True

if InStr(objScriptExec.StdOut.ReadLine, "RUNNING ") &gt; 0 then
isRoDriverLoaded = "True"
Exit Do
end if
loop

call oDfsService.AddProperty("$MPElement[Name='DFSRLib!Microsoft.Windows.FileServer.DFSR.Service']/IsRoDriverLoaded$", isRoDriverLoaded)

for each oDfsrSvc in oSvcCollection
serviceState = UCase(oDfsrSvc.State)
Next

call oDfsService.AddProperty("$MPElement[Name='DFSRLib!Microsoft.Windows.FileServer.DFSR.Service']/State$", serviceState)

If serviceState = "RUNNING" Then

Set oServiceWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &amp; sDfsrServerName &amp; "\root\microsoftdfs")
if Err.Number &lt;&gt; 0 then
strErr = "Unable to connect to local DFSR WMI provider. Error: 0x" &amp; Hex(Err.Number) &amp; " " &amp; Err.Description
WScript.Echo strErr
Wscript.Quit -1
End If

Set oServiceConfigCollection = oServiceWMI.ExecQuery ("Select ConflictHighWatermarkPercent, ConflictLowWatermarkPercent, StagingHighWatermarkPercent, StagingLowWatermarkPercent, DebugLogFilePath from DfsrMachineConfig")
if Err.Number &lt;&gt; 0 then
strErr = "Unable to query DfsrMachineConfig from local DFSR WMI provider. Error: 0x" &amp; Hex(Err.Number) &amp; " " &amp; Err.Description
WScript.Echo strErr
Wscript.Quit -1
End If

for each oServiceConfig in oServiceConfigCollection

call oDfsService.AddProperty("$MPElement[Name='DFSRLib!Microsoft.Windows.FileServer.DFSR.Service']/ConflictHighWatermarkPercent$", oServiceConfig.ConflictHighWatermarkPercent)
call oDfsService.AddProperty("$MPElement[Name='DFSRLib!Microsoft.Windows.FileServer.DFSR.Service']/ConflictLowWatermarkPercent$", oServiceConfig.ConflictLowWatermarkPercent)
call oDfsService.AddProperty("$MPElement[Name='DFSRLib!Microsoft.Windows.FileServer.DFSR.Service']/StagingHighWatermarkPercent$", oServiceConfig.StagingHighWatermarkPercent)
call oDfsService.AddProperty("$MPElement[Name='DFSRLib!Microsoft.Windows.FileServer.DFSR.Service']/StagingLowWatermarkPercent$", oServiceConfig.StagingLowWatermarkPercent)
call oDfsService.AddProperty("$MPElement[Name='DFSRLib!Microsoft.Windows.FileServer.DFSR.Service']/DebugLogFilePath$", oServiceConfig.DebugLogFilePath)

Exit For
Next
End If

Call oDiscData.AddInstance(oDfsService)

Dim oDfsrServerRoleObj, oRel, oDfsrRoObj, oRelRo, oInstFs, oRelFS

set oDfsrServerRoleObj = oDiscData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.FileServer.DFSR.6.3.RoleService']$")

call oDfsrServerRoleObj.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", sDfsrServerName)
if (oArgs.Count = 5) then
call oDfsrServerRoleObj.AddProperty("$MPElement[Name='Microsoft.Windows.FileServer.DFSR.6.3.RoleService']/IsVirtualNode$", isVirtualNode)
End If
call oDfsrServerRoleObj.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", Left(sDfsrServerName, InStr(sDfsrServerName, ".")-1))

Call oDiscData.AddInstance(oDfsrServerRoleObj)

Set oRel = oDiscData.CreateRelationshipInstance("$MPElement[Name='Microsoft.Windows.FileServer.DFSR.6.3.RoleServiceContainsService']$")

oRel.Source = oDfsrServerRoleObj
oRel.Target = oDfsService

Call oDiscData.AddInstance(oRel)

set oInstFs = oDiscData.CreateClassInstance("$MPElement[Name='FileServices63!Microsoft.Windows.FileServices.6.3.FileServer']$")
call oInstFs.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", sDfsrServerName)
call oInstFs.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", Left(sDfsrServerName, InStr(sDfsrServerName, ".")-1))
if (oArgs.Count = 5) then
call oInstFs.AddProperty("$MPElement[Name='FileServices!Microsoft.Windows.FileServer']/IsOnVirtualNode$", isVirtualNode)
End If

call oDiscData.AddInstance(oInstFs)

Set oRelFS = oDiscData.CreateRelationshipInstance("$MPElement[Name='FileServices!Microsoft.Windows.FileServer.Contains.Service']$")

oRelFS.Source = oInstFs
oRelFS.Target = oDfsrServerRoleObj

Call oDiscData.AddInstance(oRelFS)

set oDfsrRoObj = oDiscData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.FileServer.DFSR.6.3.ReadOnlyFilterDriver']$")

call oDfsrRoObj.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", sDfsrServerName)
call oDfsrRoObj.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", Left(sDfsrServerName, InStr(sDfsrServerName, ".")-1))
call oDfsrRoObj.AddProperty("$MPElement[Name='Microsoft.Windows.FileServer.DFSR.6.3.ReadOnlyFilterDriver']/DriverLoaded$", isRoDriverLoaded)

Call oDiscData.AddInstance(oDfsrRoObj)

Set oRelRo = oDiscData.CreateRelationshipInstance("$MPElement[Name='DFSRLib!Microsoft.Windows.FileServer.DFSR.Service.Contains.ServerExtensions']$")

oRelRo.Source = oDfsService
oRelRo.Target = oDfsrRoObj

Call oDiscData.AddInstance(oRelRo)

Call oAPI.Return(oDiscData)</Script></ScriptBody>
<TimeoutSeconds>900</TimeoutSeconds>
</DataSource>
</Discovery>