AD 클라이언트 모니터링 검색

Microsoft.AD.ClientPerspective.Discovery (Discovery)

AD 클라이언트 모니터링을 사용하기 위한 검색 규칙입니다. 이 규칙은 기본적으로 해제되어 있습니다. 원하는 AD 클라이언트 모니터링 시스템을 사용하려면 재정의를 사용합니다.

Knowledge Base article:

요약

AD 클라이언트 관점 검색 규칙입니다. 이 규칙은 Windows 컴퓨터 시스템(구성원 서버 또는 데스크톱 클라이언트)에서 AD 클라이언트를 모니터링할 수 있도록 합니다. 일반적으로 특정 AD 가용성을 요구하는 Windows 서버 시스템이 Exchange 서버 시스템에 대한 AD 클라이언트 모니터링 후보입니다.

구성

이 검색 규칙은 기본적으로 사용할 수 없게 설정되어 있으므로 선택한 Windows 시스템에서 사용 가능하게 수동 설정해야 합니다.

경고: 작업 환경의 모든 Windows 시스템에서 전역적으로 이 규칙을 사용하도록 설정하면 도메인 컨트롤러의 가용성에 영향을 줄 수 있으므로 피하도록 합니다. 개별 노드나 사용자 지정 그룹에 대해 선택적으로만 사용하도록 설정합니다.

Element properties:

TargetMicrosoft.Windows.Computer
EnabledFalse
Frequency14400
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
DiscoveryDataSource DataSource System.CommandExecuterDiscoveryDataSource Default

Source Code:

<Discovery ID="Microsoft.AD.ClientPerspective.Discovery" Enabled="false" Remotable="false" Target="Windows!Microsoft.Windows.Computer">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="AD!Microsoft.Windows.Server.AD.ClientPerspective"/>
</DiscoveryTypes>
<DataSource ID="DiscoveryDataSource" TypeID="System!System.CommandExecuterDiscoveryDataSource">
<IntervalSeconds>14400</IntervalSeconds>
<ApplicationName>%windir%\System32\cscript.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>$file/ADClientPerspective.vbs$ 0 $MPElement$ $Target/Id$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</CommandLine>
<TimeoutSeconds>120</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>ADClientPerspective.vbs</Name>
<Contents><Script>
'*************************************************************************
' Script Name - AD ClientPerspective Discovery
'
' Purpose - Discovers a ClientPerspective
'
' (c) Copyright 2003, Microsoft Corporation, All Rights Reserved
' Proprietary and confidential to Microsoft Corporation
'*************************************************************************

Sub Main()
'Variables
Dim oArgs,SourceType,SourceID,ManagedEntityId,TargetPricipalName
Set oArgs = WScript.Arguments
if oArgs.Count &lt; 4 Then
Wscript.Quit -1
End If

SourceType = oArgs(0)
SourceID = oArgs(1)
ManagedEntityId = oArgs(2)
TargetPricipalName = oArgs(3)

' Install the OOMADs Helper Objects
InstallOOMADs()

Dim oAPI,oDiscData
Set oAPI = CreateObject("Mom.ScriptAPI")
Set oDiscData = oAPI.CreateDiscoveryData (SourceType, SourceID, ManagedEntityId)

Dim oClientPerspectiveInstance
Set oClientPerspectiveInstance = oDiscData.CreateClassInstance("$MPElement[Name='AD!Microsoft.Windows.Server.AD.ClientPerspective']$")
oClientPerspectiveInstance.AddProperty "$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetPricipalName
oClientPerspectiveInstance.AddProperty "$MPElement[Name="System!System.Entity"]/DisplayName$", "AD Client Monitoring"

oDiscData.AddInstance(oClientPerspectiveInstance)
oAPI.Return oDiscData
End Sub


'******************************************************************************
'
' Purpose: Installs the OOMADs Helper Objects
'
' Parameters: None
'
'
Function InstallOOMADs()

Dim state
Dim installer
Dim propertyValues
Dim productGuid
Dim msiPath
Dim wshShell
Dim installDirectory
Dim msiInstallStateDefault
Dim fso
Dim path
Dim database
Dim view
Dim record
Dim installedProductVersion, productVersion
Dim systemDrive
Dim wshEnv
Dim scriptAPI

Const EVENT_ID_INSTALL_OOMADS_FAILURE = 10
Const EventSeverityWarning = 2
const EventSource = "AD ClientPerspective Discovery"

On Error Resume Next

Set scriptAPI = CreateObject("Mom.ScriptAPI")

'msiInstallStateDefault indicates that the product is installed the current user
msiInstallStateDefault = 5

productGuid = "{AA00C97B-5847-4948-824C-FC4C080B5410}"

set installer = CreateObject("WindowsInstaller.Installer")

state = installer.ProductState(productGuid)

If state = msiInstallStateDefault Then
On Error Resume Next
'check for the oomads.dll file in the correct directory
Set wshShell = CreateObject("WScript.Shell")

Set wshEnv = wshShell.Environment("PROCESS")
systemDrive = wshEnv("SYSTEMDRIVE")

if err.number = 0 Then
path = systemDrive &amp; "\Program Files (x86)\Common Files\Active Directory Management Pack Objects\oomads.dll"
Set fso = CreateObject("Scripting.FileSystemObject")

If (fso.FileExists(path)) Then
' If file is present, then log error and exit function
scriptAPI.LogScriptEvent EventSource, EVENT_ID_INSTALL_OOMADS_FAILURE, EventSeverityWarning, "This upgrade is not supported. Can not install OOMADS 64 bit version as there is already a 32 bit version of OOMADS installed"
Exit Function
End If
Err.Clear
End If
End If

' Check whether we need to install AD Helper Objects

Set wshShell = CreateObject("WScript.Shell")
installDirectory = wshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup\InstallDirectory")

msiPath = installDirectory &amp; "HelperObjects\OOMADs.msi"

' Check if the msi exists
Set fso = CreateObject("Scripting.FileSystemObject")

If (fso.FileExists(msiPath)) Then

' fetch product guid from MSI
set database = installer.OpenDatabase(msiPath,0)
set view = database.OpenView ("SELECT `Value` FROM `Property` WHERE `Property`.`Property` = 'ProductCode' ")
view.Execute
set record = view.Fetch
productGuid = record.StringData (1)
state = installer.ProductState(productGuid)

' Check whether the product has been installed
If state = msiInstallStateDefault Then

installedProductVersion = installer.ProductInfo(productGuid, "VersionString")

' Get the version of the MSI on disk
set view = database.OpenView ("SELECT `Value` FROM `Property` WHERE `Property`.`Property` = 'ProductVersion' ")
view.Execute
set record = view.Fetch
productVersion = record.StringData (1)

If installedProductVersion = productVersion Then
' Installed product version is the same as the product version on disk - no need to install
Exit Function
End If

End If

' Install OOMADs
propertyValues = "ALLUSERS=1"
installer.UILevel = 2
installer.InstallProduct msiPath, propertyValues

state = installer.ProductState(productGuid)

' Check whether the installation was successful
If state &lt;&gt; msiInstallStateDefault Then
scriptAPI.LogScriptEvent EventSource, EVENT_ID_INSTALL_OOMADS_FAILURE, EventSeverityWarning, "Active Directory Helper Objects installation failed"
End if
Else
scriptAPI.LogScriptEvent EventSource, EVENT_ID_INSTALL_OOMADS_FAILURE, EventSeverityWarning, "Active Directory Helper Objects Installation unsuccessful. MSI was not found at the specified location"
End If
End Function

Call Main()
</Script></Contents>
</File>
</Files>
</DataSource>
</Discovery>